Angular - ngModel not updating when called inside ngInclude

前端 未结 3 623
傲寒
傲寒 2021-01-03 23:10

First and foremost, the plunker: http://plnkr.co/edit/v1uTz5

This is a working demo of the issue I am running into.

I have a ng-include to inc

3条回答
  •  独厮守ぢ
    2021-01-04 00:08

    John Lindquist has a video about it. Although he doesn't quite explains why you need to use an object.

    Basically every time there is a new non-isolated scope, every property of the parent scope is copied to the new scope and, as @charlietfl explained, copying a primitive type really creates a "copy" but with objects what you get is a reference, hence the changes are global.

提交回复
热议问题