这里我无法加载JSON数据。我在下面的代码中做错了什么。有人可以指导我吗?
app.run(['$route', '$http', '$rootScope', function ($route, $http, $rootScope)
{
$http.get("sampleslist.js").success(function (data) {
alert(data);
var loop = 0, currentRoute;
for (loop = 0; loop < data[0].pages.length; loop++) {
currentRoute = data[0].pages[loop];
var routeName = "/" + currentRoute.name;
$routeProviderReference
.when(routeName, {
templateUrl: currentRoute.tempUrls + ".html",
resolve: {
load: ['$q', '$rootScope', function ($q, $rootScope) {
var deferred = $q.defer();
require([
currentRoute.tempUrls + routeName
],
function ()
{
$rootScope.$apply(function () {
deferred.resolve();
});
});
return deferred.promise;
}]
}
})
}
});
}]);