gpt4 book ai didi

javascript - angular.element(ready) 函数在 Cordova 中调用两次

转载 作者:行者123 更新时间:2023-11-27 23:53:44 24 4
gpt4 key购买 nike

以下代码的输出:

     app.controller('puntenboekjeController', function ($scope) {
function upd(){
console.log("test");
}

angular.element(document).ready(function() {
upd();
});
});

是:

test
test

在index.js中,我不引导 Angular (或其他任何地方),应用程序是在body标签中定义的,我从未使用过onDeviceReady。

最佳答案

看起来 Controller 代码调用两次确实意味着您通过使用 ng-controller 或从 SPA 的 route 定义加载 Controller 两次。

关于javascript - angular.element(ready) 函数在 Cordova 中调用两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32455621/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com