Read JSON file in AngularJS 2 Error: Cannot read property getDOM of undefined

Last Reply one year ago By dharmendr

Posted one year ago

Hi all

I am doing the example for read json from the file in angular2

here is My code.

export class JsonComponent {
  people: Object[];
  constructor(http: Http) {
    http.get('people.json').subscribe(res => {
      this.people = res.json();
  active: boolean = false;
  toggleActiveState() { = !;

I am geting error in console As Cannot read property 'getDOM' of undefined

please help me

thanks and regards


You are viewing reply posted by: dharmendr one year ago.