Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!