我在index.html中使用Angular Routes和ng view指令.我有这个:
TypeError: Cannot read property ‘get’ of undefined@H_301_5@
angular.module('app.controllers',[]) .controller('MainCtrl',['$scope',function ($scope) { $scope.status = "Accueil"; }]) .controller('ViewCtrl',function ($scope,$http) { $http.get('mobile.PHP/getAnnonces/limit=10') .success(function(data,status,headers,config) { $scope.posts = data; }) .error(function(data,config) { // log error }); }]) ...
如果我测试URL,我的脚本返回JSON(使用json_encode).我在哪里错了?
谢谢你的帮助,
问候