2014-10-16 56 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中复制它。

相关问题