控制器未注册因果茉莉花angularjs错误
(function() {
angular.module('Citi.iv.FC').controller('SampleController', sampleController);
sampleController.$inject = ['$scope'];
function sampleController($scope) {
alert('hi');
var vm = this;
}
})();
规格文件如下
describe('myserv', function () {
var $rootScope,$scope, $timeout, $filter, $uibModal, Upload, CreditCardService,controller;
beforeAll(function () {
angular.mock.module('ui.router');
angular.mock.module('Citi.iv.FC');
});
beforeEach(angular.mock.inject(function( _$rootScope_, _$controller_) {
$scope = _$rootScope_ .$new();
$controller = _$controller_;
controller = $controller('SampleController', {
$scope: $scope,
});
}));
it('ServiceTestSpec', function () {
expect(3 + 3).toBe(6);
});
});