I'm working on a function and can someone give advice on how to specify a function that is out side a function? Inside the if statment I would like to call the otherfunction().
@Injectable()
export class menuService {
constructor (){}
testing(){ console.log('something')}
loadwidget(){
// not able to call this function
this.testing()
}
}
Error that i get is "this.testing is not a function"
ERROR TypeError: this.testing is not a function
at Object.menuService.loadwidget (http://localhost:3000/main.bundle.js:755:14)
at Object.eval [as handleEvent] (ng:///AppModule/tbuttonsComponent.ngfactory.js:36:41)
at handleEvent (http://localhost:3000/vendor.dll.js:13146:138)
at callWithDebugContext (http://localhost:3000/vendor.dll.js:14354:42)
at Object.debugHandleEvent [as handleEvent] (http://localhost:3000/vendor.dll.js:13942:12)
at dispatchEvent (http://localhost:3000/vendor.dll.js:10121:21)
at http://localhost:3000/vendor.dll.js:10711:38