0
'use strict';
define([], function() {
function myController($scope) {
//Do something...
};
}
myController.inject = ['$scope'];
return myController;
对于上述控制器,我无法调用myController。请参阅下面的代码(茉莉花)。
describe('myController', function() {
'use strict';
var controller, scope;
beforeEach(inject(function($rootScope, $controller) {
controller = $controller;
scope = $rootScope.$new();
}));
describe('sum', function() {
it('1 + 1 should equal 2', function() {
expect(scope.listingsBarController()).toBe(2);
});
});
});
它说不确定是不是一个函数(在评估scope.listingsBarController。
有什么不对?