javascript - How can I bind ngModel through multiple directives with isolate scopes in AngularJs? -


i trying bind property via ngmodel in layer of directives 3 levels deep. fine, except middle level contains ng-if believe creates new scope. binding lost @ point.

i have created jsfiddle explain situation: http://jsfiddle.net/5fmck/2/

note works if ng-if directive removed, using ng-if instead of ng-show performance reasons

does know how can original ngmodel update 'inputdirective' template in fiddle?

simple :3

just remember, child scope created = use reference $parent :)

<div ng-if='somecondition'>     <span>in wrapper</span>     <input-directive ng-model='$parent.ngmodel'></input-directive> </div> 

http://jsfiddle.net/5fmck/3/

// upd

as know need use reference $parent if ngmodel primitive, not object.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -