只是試圖讀取一個URL,我得到以下錯誤。
「未捕獲的錯誤:[$注射器:modulerr]」
任何想法?
<div ng-app="app" ng-controller="ctrl">
{{catalog}}
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js"></script>
var app = angular.module('app', ['jsonService']);
angular.module('jsonService', ['ngResource'])
.factory('JsonService', function($resource) {
return $resource('https://s3-us-west-2.amazonaws.com/s.cdpn.io/93930/catalog.json');
});
app.controller('ctrl', function($scope, JsonService){
JsonService.get(function(data){
$scope.catalog = data;
});
});