【发布时间】:2016-02-19 13:08:41
【问题描述】:
所以,我的问题是如何让控制器方法自己调用(它在控制器构造函数中定义),例如:
this.getExportPath = function() {
setTimeout(function() {
console.log(1);
return getExportPath();
}, 1);
}
我试过了:
this.getExportPath();
getExportPath();
return getExportPath();
return this.getExportPath();
希望得到帮助。
【问题讨论】:
-
var getExportPath = function() { .. }然后getExportPath();..? -
但是我不能在构造函数之外调用函数。
-
您的意思是要对函数进行递归调用吗?
-
你可以使用
$interval..
标签: javascript jquery angularjs frontend