2014-10-16 2 views
0
각도

에서 모듈 레지스터 내가 아래 모델 등록 할 때 :오류 인젝터

var angularTest = angularTest || {}; 
angularTest.app = angular.module('angularTest', ['xPlat.service', 'xPlat.controller', 'xPlat.directives', 'xPlat.repository']).run(function (DB) { 
    DB.init(); 
}); 
angular.module('xPlat.config', []); 
angular.module('xPlat.directives', []); 
angular.module('xPlat.controller', []); 
angular.module('xPlat.service', []); 

을 내가 올바른 사용과 컨트롤러가 아래 (이 오류가 아닙니다) :

angularTest.app.controller('logInController', ['$scope', '$http', function ($scope, $http) { 
    $scope.login = function() { 
     var request = $http({ 
      method: "post", 
      url: "http://localhost:4309/Account/Login", 
      data: "" 
     }) 
    } 
}]); 

하지만, 아래 컨트롤러에 오류가 있습니다 :

(function() { 
    'use strict'; 
    angular.module("xPlat.controller", ['xPlat.service']) 
     .controller('itemController', function ($scope, itemService) { 
      // todo something 

     }); 
})(); 

위와 같이 logInController와 같이 변경하고 싶습니다. 어떻게 변경합니까?

답변

0

단일 JS 파일에 코드를 입력하면 코드가 작동합니다. index.html 페이지에 xPlat.controller가 들어있는 파일을 포함시키지 않았다고 가정합니다 (또는 미니 플리핑하는 경우 포함하지 않음).

추가 도움이 필요하면 jsfiddle에서 복제 해 볼 수 있습니까?

관련 문제