我在我的应用程序中使用 $timeout 来在单击按钮时显示旋转的微调器。我这样做 -> answer
我有这样的
vm.upShipment = function(){
vm.test="true";
vm.saveButtonText = "Saving";
$timeout(function(){
vm.test="false";
vm.saveButtonText = "Save";
},1000);
...
我尝试通过尝试此 question 中的所有内容来解决它。指令已正确注入(inject),但它不断向我抛出相同的类型错误。
TypeError: $timeout is not a function
最佳答案
函数中有 $event
,但 [ ] 中没有。这就是为什么 $timeout
不起作用。在函数内注入(inject) $event
。
如果 $event 不存在,请尝试删除。
关于javascript - 罕见的 TypeError 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45642465/