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) {
 $ = 'John';
 $ = 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" />
   Name: {{name}}

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

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.