angularjs - Angular 2 this.generateTree is not a function -


i have 2 functions in component. onelementclick binded element in html. every time click on element, get:

this.showhalo not function

why case?

showhalo(view, opt) {   // code }   onelementclick(view) {  // code   function click() {     this.showhalo(view, { animation: true });   } } 

i tried this, same thing.

myfunc(){    console.log("test"); }  onelementclick(view) {    self = this;    self.myfunc(); } 

correct this pointer. :

showhalo(view, opt) {   // code }   onelementclick(view) {  // code var _this = this;   function click() {     _this.showhalo(view, { animation: true });   } } 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -