0
這裏是我的測試文件:測量角指令 - 不能編譯指示
describe('Clinical App', function() {
var template, element;
beforeEach(module('clinicalApp'));
describe('clinicalHeader', function() {
beforeEach(module('app/views/header.html'));
beforeEach(inject(function($templateCache, $compile, $rootScope) {
template = $templateCache.get('app/views/header.html');
$templateCache.put('views/header.html', template);
var directive = angular.element('<clinical-header></clinical-header>');
element = $compile(directive)($rootScope);
$rootScope.$digest();
}));
it('should have a list of links', function() {
var links = element.find('a');
expect(links.length).toBe(4);
});
});
});
我不斷收到一個Error: [$compile:multidir] Multiple directives [clinicalHeader, clinicalHeader] asking for template on:
錯誤。我沒有看到我加載了2次的東西。有人可以看看嗎?