Reputation: 639
When user enters any value in one textbox the same value should get populated in another texbox, i tried below one but not working.Please suggest.
<title></title>
<script src="Scripts/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module('myApp', []);
app.controller('myCntrl', function ($scope) {
$scope.txt1 = "AngularDemo";
});
</script>
<body>
<form id="form1" runat="server" ng-app="myApp">
<div data-ng-controller="myCntrl">
<asp:TextBox ID="TextBox1" runat="server" ng-model="txt1"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" ng-bind="txt1" Text="{{txt1}}" style="border-color:{{txt1}}"></asp:TextBox>
</div>
</form>
</body>
</html>
Upvotes: 1
Views: 618
Reputation: 11398
Just use ng-model everywhere
<form id="form1" runat="server" ng-app="myApp">
<div data-ng-controller="myCntrl">
<asp:TextBox ID="TextBox1" runat="server" ng-model="txt1"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" ng-model="txt1" style="border-color:{{txt1}}"></asp:TextBox>
</div>
</form>
What did you try to achieve with the following : Text="{{txt1}}"
Upvotes: 1