The largest Interview Solution Library on the web


« Previous | 1 | 2 | 3 | Next »
I'm a new line. {{foo}}
I'm a Break line. {{foo}}
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://javatechnologycenter.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<script type='text/javascript'>
function MyCtrl($scope) {<!-- from infovision-->
$scope.foo = "I'm foo!";
$scope.lines = [];
$scope.addLine = function () {
$scope.lines.push($scope.lines.length);
};
$scope.breakLine= $scope.$watch(function(){
$scope.lines.push($scope.lines.length);
})
}
</script>
</head>
<body>
<div ng-app ng-controller="MyCtrl">
<button ng-click="addLine()">Add a line</button>
<div ng-repeat="line in lines">
I'm a new line. {{foo}}
</div>
</div>
<div ng-app ng-controller="MyCtrl">
<button ng-click="breakLine()">Break Line</button>
<div ng-="line in lines">
I'm a Break line. {{foo}}
</div>
</div>
</body>
</html>
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com