Scope inheritance in Angular

后端 未结 2 773
甜味超标
甜味超标 2020-12-20 04:22

I\'m new to Angular, so I\'m trying to follow tutorial and just don\'t get it.What confuses me is the dot notation:

2条回答
  •  醉梦人生
    2020-12-20 04:54

    In the first code, data as an object is a common object between three scopes and each scope has reference to data.So when data.message is changed all three scope show the changed message. But in the second case the message is a string witch is a value type not an object. Each scope has its own message and changing one of theme will not effect others.

提交回复
热议问题