angularJS通过http请求添加JSON

时间:2014-10-19 17:05:23

标签: json angularjs

想在此播放beercat的JSON(' bieres.json') 我该怎么办?

 function() {
      var app = angular.module('monStore', []);

    app.service('dataService', function($http) { 

    this.getData = function() {
         return $http({
            method: 'GET',
            url: 'bieres.json'
         });
     }
    });

        app.controller('StoreController', function($scope,dataService){

         this.bieres = [];

        dataService.getData().then(function(dataResponse) {
            $scope.bieres = dataResponse.data;
        });

    ...

      });

我认为这是我的访问权限。这是错误的,

Json已加载到控制台中,但结果为空白页

0 个答案:

没有答案