Hi everybody.

I have two scripts.

The first script works fine so , I can change input value 
but when I run second script then I  cannot change input value.

have any idea related to this issue?

thanks.

1.
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script src= 
"http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js";></script>
<script>
  var app = angular.module("myApp",[]).
   controller("MainController",["$scope",function($scope){
    $scope.name = "Test";
    $scope.write = function(data){
       $scope.name = data;
     }
}]);
</script>
</head>
<body ng-controller="MainController">

<p>Name : <input type="text" ng-keyup="write(name)" ng-model="name" 
placeholder="Enter name here"></p>
<h1>Hello {{name}}</h1>

</body>
</html>

2.
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script src= 
"http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js";></script>
<script>
  var app = angular.module("myApp",[]).
   controller("MainController",["$scope",function($scope){
    $scope.name = "Test";
    $scope.write = function(data){
       $scope.name = data;
     }
}]);
</script>
</head>
<body ng-controller="MainController">

<p>Name : <input type="text" ng-keyup="write(name)" 
ng-model="name='unchangable'" placeholder="Enter name here"></p>
<h1>Hello {{name}}</h1>

</body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to