angularjs - Including Angular localStorageService in module causes native error -
this code works; getdata() function invoked:
var app = angular.module('poc', []); app.controller('pocctrl', ['$scope','$timeout', function ($scope, $timeout) { <snip> $timeout(function () { $scope.getdata() }, 250, $scope); ]); but code below , references localstorageservice, causes native error in ie when try run , debug page. getdata() function never invoked. missing? local storage service have included in module too?
var app = angular.module('poc', []); app.controller('pocctrl', ['$scope','$timeout', 'localstorageservice', function ($scope, $timeout, localstorageservice) { $timeout(function () { $scope.getdata() }, 250, $scope); ]);
use
app.controller('pocctrl', function ($scope, $timeout, localstorageservice) { ); i don't know why controller doesn't take localstorageservice in way using, had same error today. see question (i myself looking explanation though)
Comments
Post a Comment