angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

ng:include inside ng:repeat doesn't render

Open dphung20 opened this issue 13 years ago • 11 comments

ng:include nested inside a ng:repeat doesn't seem to be rendering anymore. This use to be working in version 1.1.5 but not on the latest build

working version: http://jsfiddle.net/KAFCK/3/ non-working version: http://jsfiddle.net/KAFCK/46/

reference discussion: https://groups.google.com/forum/#!topic/angular/JjmnPQl-SWg

dphung20 avatar Aug 16 '13 15:08 dphung20

ng:include also does not render when used in the same element with an ng-if like:
<div ng-if="true" ng-include src="'/foo.html'"></div>

or with nested divs like

<div ng-if="true">
    <div ng-include src="'/foo.html'"></div>
</div>

Both worked in 1.1.5

working version: http://jsfiddle.net/jonyschak/9NygZ/2/ non-working version: http://jsfiddle.net/jonyschak/9NygZ/

jonyschak avatar Aug 16 '13 19:08 jonyschak

Recursive ng-includes work in 1.1.5

working version : http://jsfiddle.net/bchoii/qPnxN/2/

Recursive ng-includes do not work in 1.2.0rc1

non-working version : http://jsfiddle.net/bchoii/qPnxN/3/

bchoii avatar Aug 18 '13 15:08 bchoii

ng-include in ng-switch no longer works in 1.2.0rc1: http://jsfiddle.net/YSzxN/

Working in 1.1.5 http://jsfiddle.net/YSzxN/1/

dkingsbury avatar Aug 20 '13 20:08 dkingsbury

Dupe of #3584. Transclusion is seriously broken in 1.2 rc1.

kevin-smets avatar Aug 21 '13 09:08 kevin-smets

:+1:

chiefy avatar Aug 22 '13 21:08 chiefy

I'm running into this issue, too.

nrw avatar Aug 25 '13 06:08 nrw

You can try running the latest snapshot, that solved a lot (maybe all?) transclusion problems:

http://code.angularjs.org/snapshot/

kevin-smets avatar Aug 25 '13 06:08 kevin-smets

Thanks for the tip! The latest snapshot solved my problem.

nrw avatar Aug 25 '13 07:08 nrw

As mentioned here and in #3584, this issue is solved in the latest snapshot.

Comment on #3584 if you are still seeing bugs with the latest snapshot.

jbdeboer avatar Aug 29 '13 00:08 jbdeboer

@jbdeboer It seems to work with the latest snapshot here is an example: http://jsfiddle.net/valentinvieriu/YSzxN/9/ but if we put the ng-switch and ng-include on the same div it starts to act very strange. Here is an example: http://jsfiddle.net/valentinvieriu/YSzxN/10/

valentinvieriu avatar Aug 29 '13 18:08 valentinvieriu

@valentinvieriu ngInclude always needs it's own element even if it's on the same element as ngSwitch. With 1.2rc1 ngInclude "transcludes" itself (so it clones itself) each time the expression changes. NgSwitch also creates and recreates the same elements, but since ngInclude does that too then they compete against each other. The solution right now is to create a new HTML tag with the ngInclude info inside of each switch tag.

matsko avatar Aug 30 '13 04:08 matsko