I'm having trouble using isolated scope with templateUrl.
My directive test:
beforeEach(ngModule('app.directives'));
var scope, compile
beforeEach(inject(function($rootScope, $compile){
scope = $rootScope.$new();
compile = $compile;
}));
it('Replaces the element with the appropriate content', function(){
var element = compile('<download-detail-header></download-detail-header>')(scope);
expect(element.html()).to.equal('<p>Hello World!</p>');
});
My directive:
function downloadDetailHeader() {
return {
restrict: 'EA',
scope: {},
template: '<p>Hello World!</p>'
// templateUrl: 'download_detail_header/views/downloadHeader.html'
}
}
downloadHeader.html
<p>Hello World!</p>
The test passes with template, seemingly because ng-isolate-scope is added to a class on the directive element. The test does not pass with the templateUrl provided, and no ng-isolate-scope is placed on the directive element.
Can anyone shed some light on this issue?