Hi All,
I am using one way binding in ng-repeat. still i want to refresh
the ng-repeat when the array value is changed. please suggest with your
ideas
Refer the below plunker URL .
http://plnkr.co/edit/YU3dSLHD7AachnzpeGIR?p=preview
*Example *
<html ng-app="todoApp">
<head>
<title>
TO DO List
</title>
<link rel="stylesheet"
href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/readable/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<script data-require="angular.js@*" data-semver="1.3.1"
src="//code.angularjs.org/1.3.1/angular.js">
</script>
<script>
var todoApp = angular.module("todoApp",
[]).config(function($compileProvider, $httpProvider) {
$compileProvider.debugInfoEnabled(true);
});
todoApp.controller("ToDoCtrl", function($scope) {
$scope.data = [12, 23, 45, 67, 89];
$scope.add = function(dtata) {
$scope.data.push(dtata);
}
});
</script>
</head>
<body ng-controller="ToDoCtrl">
<!-- ...elements omitted for brevity... -->
<div class="panel">
<div class="input-group">
<input class="form-control" />
<input type="text" ng-model="numberData"/>
<button type="submit" ng-click="add(numberData)">
add
</button>
</div>
<table class="table table-striped">
<thead>
<tr>
<th >
Numbers
</th>
</tr>
* <tr ng-repeat="de in ::data"> <th >
{{::de}} </th> </tr>*
</thead>
<tbody>
</tbody>
</table>
</div>
</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.