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

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -