Organizational Research By

Surprising Reserch Topic

controller and ng model directive in angularjs


controller and ng model directive in angularjs  using -'javascript,angularjs'

There is the following code:

function MyController($scope) {
 $scope.name = 'John';
 $scope.show = true;
}
<div ng:app>
 <form name="form" ng-controller="MyController">
   <div data-ng-switch="show">
     <input data-ng-switch-when="true" type="text" data-ng-model="name" />
   </div>
   Name: {{name}}
 </form>
</div>


It code works strangely: when my views has been loaded I see input with 'John' value, it's good. But when I'm trying to input some new value in field my {{name}} output doesn't change. Why??
    
asked Oct 11, 2015 by jekbishnoi
0 votes
3 views



Related Hot Questions



Government Jobs Opening


...