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

193
Visualizações
Angular2 - How to get properties from class with getter and setter?

I am trying to access class properties and i able to do that. but the problem is i am not able to access get and set method from class.

export class PageModel {
    public ParentID: string = null;
    public Type: string = null;
    public Order: number = 0;

    public get ApplicationManager(): ApplicationManager {
        if (ApplicationManager.Current != null && ApplicationManager.Current.Model != null) {
            return ApplicationManager.Current;
        }
        else {
            return null;
        }
    }

    // Many more methods below.
}

Below is logic for fetching properties from class.

protected GetProperties(obj: any): Array<string> {
    let properties: Array<string> = new Array<string>();

    if (obj != null && typeof obj == "object") {
        for (var property in obj) {
            if (obj.hasOwnProperty(
                 properties.push(property);                    
            }
        }
    }

    if (properties != null)
        properties.sort();

    return properties;
}

In above logic i able to get list of properties but i am not getting get and set method.

over 4 years ago · Santiago Trujillo
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