Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
Entidades de extensión de Angular2 Breeze

Estoy usando Angular2 junto con Breeze Metadata Generator. Tengo una clase de persona y quiero extender la entidad con algunas propiedades personalizadas en el cliente.

¿Esta es la manera correcta de hacerlo?

 import { EntityBase } from '../EntityBase'; import { ProfileFaculty } from './ProfileFaculty'; import { RoadRunner } from './RoadRunner'; import { Security } from './Security'; import { ProfileStudent } from './ProfileStudent'; /// <code-import> Place custom imports between <code-import> tags import { EcLocalDataService } from "../../common/static" /// </code-import> export class Person extends EntityBase { // Generated code. Do not place code below this line. personId: number; isActive: boolean; bbUserId: string; bbUserName: string; lastName: string; firstName: string; avatarLocation: string; goByName: string; mpGender: string; mpAffiliation: string; mpPaygrade: string; mpComponent: string; email: string; registrationComplete: boolean; mpInstituteRole: string; modifiedById: number; modifiedDate: Date; faculty: ProfileFaculty; roadRunnerAddresses: RoadRunner[]; security: Security; student: ProfileStudent; /// <code> Place custom code between <code> tags salutation: string; prettyInstituteRole: string; constructor() { super(); this.salutation = EcLocalDataService.getSalutation(this.mpPaygrade, this.mpComponent, this.mpAffiliation); this.prettyInstituteRole = EcLocalDataService.prettyInstituteRole(this.mpInstituteRole); } /// </code> }

También noté que en el ejemplo de Temphire hay este fragmento de código. Cada clase lo tenía, pero la mía no. ¿Qué hace esto?

 static initializer(entity: PhoneNumber) { }
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Esto funcionó.

 import { EntityBase } from '../EntityBase'; import { ProfileFaculty } from './ProfileFaculty'; import { RoadRunner } from './RoadRunner'; import { Security } from './Security'; import { ProfileStudent } from './ProfileStudent'; /// <code-import> Place custom imports between <code-import> tags import { EcLocalDataService } from "../../common/static" /// </code-import> export class Person extends EntityBase { // Generated code. Do not place code below this line. personId: number; isActive: boolean; bbUserId: string; bbUserName: string; lastName: string; firstName: string; avatarLocation: string; goByName: string; mpGender: string; mpAffiliation: string; mpPaygrade: string; mpComponent: string; email: string; registrationComplete: boolean; mpInstituteRole: string; modifiedById: number; modifiedDate: Date; faculty: ProfileFaculty; roadRunnerAddresses: RoadRunner[]; security: Security; student: ProfileStudent; /// <code> Place custom code between <code> tags //salutation: string; //prettyInstituteRole: string; constructor() { super(); //this.salutation = EcLocalDataService.getSalutation(this.mpPaygrade, this.mpComponent, this.mpAffiliation); //this.prettyInstituteRole = EcLocalDataService.prettyInstituteRole(this.mpInstituteRole); } get salutation():string { return EcLocalDataService.getSalutation(this.mpPaygrade, this.mpComponent, this.mpAffiliation) } get prettyInstituteRole(): string { return EcLocalDataService.prettyInstituteRole(this.mpInstituteRole); } get prettyName(): string { return `${this.salutation} ${this.firstName} ${this.lastName}` } /// [Initializer] static initializer(entity: Person) { } /// </code> }
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda