javascript - AngularJS 1.2 ngInclude inside ngIf -


i'm running odd behavior when putting nginclude inside ngif or ngswitch.

for example, take following:

<button ng-click="showinctemplate = !showinctemplate">toggle included template</button> <button ng-click="showinlinetemplate = !showinlinetemplate">toggle inline template</button>  <div ng-if="showinctemplate">     <p>included template:</p>     <div ng-include="'template.html'"></div> </div>  <div ng-if="showinlinetemplate">     <h1>inline template</h1> </div> 

(http://plnkr.co/edit/gulbwnkb0gqs8dwz0v6u)

the buttons toggle options render divs follow. inline example behaves expected, content appearing or disappearing on click.

the div child include seems not include template when first drawn, includes repeatedly on every subsequent redraw.

what's going on here? see breaking changes around nginclude, there other way should doing this? or bug in angular?

edit:

it looks in angularjs github issue tracker: https://github.com/angular/angular.js/issues/3627

they've fixed in snapshot:

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


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -