Scope issues with Angular UI modal

后端 未结 5 611
萌比男神i
萌比男神i 2020-12-02 06:25

I\'m having trouble understanding/using the scopes for an angular UI modal.

While not immediately apparent here, I have the modules and everything set up correctly

5条回答
  •  温柔的废话
    2020-12-02 06:53

    When nested scopes are involved, do not bind s directly to members of the scope:

     
    

    Bind them to at least a level deeper:

     
    

    The reason is that scopes prototypically inherit their parent scope. So when setting 1st level members, these are set directly on the child scope, without affecting the parent. In contrast to that, when binding to nested fields (form.name) the member form is read from the parent scope, so accessing the name property accesses the correct target.

    Read a more detailed description here.

提交回复
热议问题