0
希望我不复制现有的问题... 我试图访问附加到“我的服务”中的“this”的函数,但是我必须从内部执行此操作jQuery的事件绑定。访问jQuery代码中的角度范围
但我从角度得到“undefined不是函数”的错误。
代码:
app.service("whatever",function(){
this.instantiatePreIds = function() {
/**whatever code**/
}
this.checkOnLoad = function() {
angular.element(window).bind("popstate", function (e) {
this.instantiatePreIds(); /***this row throws that error***/
});
}
});
有什么建议?谢谢。