Wednesday, June 25, 2014

Angularjs how to access rootScope model or function

<div ng-app="miniapp">

    This is your name {{name}}

    

    <div ng-repeat="a in [1]">

         <div ng-repeat="b in [1]">

             <div>

                 Name 1: <input type="text" ng-model="$parent.$parent.name">

             </div>        

             <div>

                 Name 2: <input type="text" ng-model="$root.name">

             </div>

        </div>

    </div>    

</div>

No comments: