Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
Angular2 Extending Breeze Entities

I am using Angular2 along with the Breeze Metadata Generator. I have a person class and I want to extend the entity with some custom properties on the client.

Is this the right way to do it?

 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>

}

Also I noticed in the Temphire example there is this piece of code. Each class had it but mine don't. What does this do?

static initializer(entity: PhoneNumber) { }
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

This worked.

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda