在 Controller 中注入 StateService 时遇到此问题
错误:[$injector:unpr] 未知提供者:StateServiceProvider <- StateService
//Service
module ba.entry {
export class StateService{
constructor () {}
}
angular
.module('ba.entry')
.service('ba.entry.StateService', StateService);
}
// Controller
module ba.entry {
export class StateController {
static $inject = ['$scope', 'ba.entry.StateService'];
constructor (public $scope: Scope, stateService) {}
}
angular
.module('ba.entry')
.controller('ba.entry.StateController', StateController);
}
// 应用配置
module ba {
'use strict';
angular.module('ba.entry', []);
angular
.module('betting-assistance', [
'ui.router',
'AutoCompleteApp'
]);
}