1.使用服务首先注册服务($http)
module.controller('In_theatersController',['$scope','$http',function ($scope,$http) {
$scope.name = '北京电影学院1';
}]);
2.使用http服务
module.controller('In_theatersController',['$scope','$http',function ($scope,$http) {
$scope.name = '北京电影学院1';
$http.get('../app/datas/in_theaters.json').then(function (req) {
console.log(ok);
console.log(req);
}),function (err) {
console.log(err);
}
}]);
3../代表项目的根目录moviecat
../app/datas/in_theaters.json