Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

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

Government Jobs Opening