In Focus

Forums - C# Corner

Forum guidelines


  • 939
  • 719
  • 44.1k

AngularJS: update the model in parent scope from inside the

May 19 2017 10:28 AM
i am new in angular and learning. when i see the code from this url then things is not clear.

see the code and tell me why model data can not be updated from child scope ?
  1. <input type="text" ng-model="data">  
  2. <div ng-if="true">  
  3. <input type="text" ng-model="data">  
  4. </div>  
see the below code again and tell me what special things is there for which model in parent scope is updating from inside the child scope ?
  1. <input type="text" ng-model="data.input">  
  2. <div ng-if="true">  
  3. <input type="text" ng-model="data.input">  
  4. </div> 
they use just data.input and parent data is updated from child scope....this is not clear. what is so special in .input keyword ?

please help me to understand how second example can update parent data just by .input keyword ?

also tell me when child scope gets created ? when we use ng-if or ng-show then ?


Answers (1)


Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now