Javascript 错误:[$injector:unpr]未知提供程序:$resourceprovider<;-$资源<;-电话角工厂

Javascript 错误:[$injector:unpr]未知提供程序:$resourceprovider<;-$资源<;-电话角工厂,javascript,angularjs,Javascript,Angularjs,我在注入资源时遇到问题 错误:[$injector:unpr]未知提供程序:$resourceprovider修复程序很简单。您在phone.factory.js 'use strict'; angular. module('getphone'). factory('Phone', ['$resourse', // should be resource function($resourse) { return $resourse('phone/:phoneId.json', {},

我在注入资源时遇到问题


错误:[$injector:unpr]未知提供程序:$resourceprovider修复程序很简单。您在phone.factory.js

'use strict';
angular.
module('getphone').
factory('Phone', ['$resourse',  // should be resource
  function($resourse) {
    return $resourse('phone/:phoneId.json', {}, {
      query: {
        methode: 'GET',
        params: {phoneId: 'phones'},
        isArray: true
      }
    });
  }
]);

解决办法很简单。您在phone.factory.js

'use strict';
angular.
module('getphone').
factory('Phone', ['$resourse',  // should be resource
  function($resourse) {
    return $resourse('phone/:phoneId.json', {}, {
      query: {
        methode: 'GET',
        params: {phoneId: 'phones'},
        isArray: true
      }
    });
  }
]);

哦对谢谢你。。。对谢谢
'use strict';

angular.module('phoneList', ['getphone']);
'use strict';

angular.
module('phoneList').
component('phoneList', {
  templateUrl: 'phone-list/phone-list.template.html',
  controller: ['$http', '$scope', 'Phone',
  function PhoneListController($http, $scope, Phone){
    var self = this;
    $scope.search = {};
    .....
'use strict';

angular.module('getphone', ['ngResource']);
'use strict';

angular.
module('getphone').
factory('Phone', ['$resourse',
  function($resourse) {
    return $resourse('phone/:phoneId.json', {}, {
      query: {
        methode: 'GET',
        params: {phoneId: 'phones'},
        isArray: true
      }
    });
  }
  ]);
'use strict';
angular.
module('getphone').
factory('Phone', ['$resourse',  // should be resource
  function($resourse) {
    return $resourse('phone/:phoneId.json', {}, {
      query: {
        methode: 'GET',
        params: {phoneId: 'phones'},
        isArray: true
      }
    });
  }
]);