试图转换这个
.service('dataStore', function($localStorage,$scope){
this.entfeeds=[];
this.topfeeds=[];
this.intfeeds=[];
})
.controller('GenFeedCtrl', function ($scope,....
$scope.feeds = FeedList.get(feedSources, dataStore.topfeeds);
哪个有效,除了在电话科尔多瓦上运行时,它只返回两个项目
所以我试图使用 ngStorage 来存储数组
.service('dataStore', function($localStorage,$scope){
$scope.$storage = $localStorage.$default({
etf:[],
tpf:[],
itf:[]
});
this.entfeeds=$storage.etf;
this.topfeeds=$storage.tpf;
this.intfeeds=$storage.itf;})
.controller('GenFeedCtrl', function ($scope,....
$scope.feeds = FeedList.get(feedSources, dataStore.topfeeds);
但不适用于浏览器emu,会出现以下错误
Error: [$injector:unpr] Unknown provider: $scopeProvider <- $scope <- dataStore
http://errors.angularjs.org/1.3.13/$injector/unpr?p0=copeProvider%20%3C-%20%24scope%20%3C-%dataStore在http://localhost:8100/lib/ionic /js/ionic.bundle.js:8762:12