Skip to content Skip to sidebar Skip to footer

How To Communicate In Angular 4 App With The Dom?

I'm try to invoke addItems method however, I'm an getting error: Uncaught TypeError: this.addItems is not a function I'm using Angular 4 with jQuery and fullpage.js library. page

Solution 1:

I'd suggest you to move this call from constructor to ngOnInit()

constructor(private newService: MyDataService) {
  this.addItems(0, this.no_of_post);
 }

And thing is that this points on its class. You don't have property no_of_post in that class.

Also you have issue with this string

onLeave: function(index, nextIndex, direction) {

Use arrow function

onLeave: (index, nextIndex, direction) => {

Post a Comment for "How To Communicate In Angular 4 App With The Dom?"