我在我的角度控制器中有一個函數(shù),我希望可以在準備好文檔的文件上運行此函數(shù),但是我注意到在創(chuàng)建dom時,它會運行角度函數(shù)。 function myController($scope) { $scope.init = function() { // I'd like to run this on document ready } $scope.init(); // doesn't work, loads my init before the page has completely loaded }有人知道我該怎么做嗎?
如何在準備好文檔的AngularJS控制器中運行函數(shù)?
慕標5832272
2019-10-14 14:33:16