0
此代碼有效;該getData()
函數被調用:在模塊中包含Angular localStorageService會導致本機錯誤
var app = angular.module('POC', []);
app.controller('POCCtrl', ['$scope','$timeout', function ($scope, $timeout) {
<snip>
$timeout(function() {
$scope.getData()
}, 250, $scope);
]);
但下面的代碼,它引用localStorageService
,導致IE本地錯誤,當我嘗試運行和調試頁面。從不調用getData()
函數。我錯過了什麼?本地存儲服務是否也必須包含在模塊中?
var app = angular.module('POC', []);
app.controller('POCCtrl', ['$scope','$timeout', 'localStorageService',
function ($scope, $timeout, localStorageService) {
$timeout(function() {
$scope.getData()
}, 250, $scope);
]);