-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Template of directive with replace:true is not compiling when directive is in another external template #1859
Comments
Passing DOMNode#childNodes to compileNodes when compiling remote template, so that directives with replace:true can be compiled. The previous version used jqLite#contents which returned collection that was not updated during the compilation. Closes #1859
Running into this issue on Angular 1.1.5 while trying to test an element directive with beforeEach ->
module 'app'
inject ($rootScope, $compile) ->
scope = $rootScope.$new()
element = angular.element("<div>\n <section name=\"Data\" icon=\"eye\"></section>\n</div>")
$compile(element)(scope)
scope.$digest()
it 'should replace directive with template', ->
console.log "ELEMENT: " + element.html() In the test output, the html returns dom with the |
where is your |
Yes. In this particular scenario, $templateCache is used in a file loaded prior to the test. |
So in this case the template will be loaded async (even though it is in the cache). Can you check whether the directive is actually being compiled? Would you be able to provide a running example of the problem? |
Getting a weird error now when running on Plunker: http://plnkr.co/edit/ufrNwS3CPuFpDNy6LVoU?p=preview
|
Never mind the TypeError, I forgot to return the directive object definition. The problem of not replacing the directive template still persists though. |
@IgorMinar Any ideas? |
This is an issue again as described in #3245. |
See http://jsfiddle.net/fuqwM/8/
The text was updated successfully, but these errors were encountered: