0
'use strict';
define([], function() {
function myController($scope) {
//Do something...
};
}
myController.inject = ['$scope'];
return myController;
});Die Funktion eines Controllers in Jasmine kann nicht aufgerufen werden
Für den obigen Controller kann ich myController nicht aufrufen. Pls siehe Code unten (Jasmin).
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);
});
});
});
Er sagt, dass nicht definiert ist keine Funktion (während scope.listingsBarController Auswertung.
Was ist falsch?