angularjs - Angular UI Bootstrap Modal doesn't work with ng-include -


live example: http://plnkr.co/edit/wws3ufb3iz0cai4u2x04?p=preview

when "open modal 1" clicked, following error thrown:

error: dialog.open expected template or templateurl, neither found. use options or open method specify them.

however, modal 2, doesn't use ng-include, works fine.

also, if ui-bootstrap-tpls-0.1.0.js included instead of ui-bootstrap-tpls-0.2.0.js, works fine.

any ideas?

i believe issue result of changing modal directive terminal. means other directives (e.g. ng-include) not processed along modal. here's commit made change:

https://github.com/angular-ui/bootstrap/commit/ec796ec2299d03ddfb821e97047c0329f11ab962#src/modal/modal.js

i don't know enough know why directive should terminal, 1 easy solution use ng-include child of modal, rather second directive acting on same element. here's mean:

<div modal="opened1">     <ng-include src="'modal1.html'"></ng-include> </div>  

updated live example: http://plnkr.co/edit/niyvil9l8l8nibz56s4z?p=preview


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -