Skip to content

Instantly share code, notes, and snippets.

@tps2015gh
Created June 8, 2017 16:43
Show Gist options
  • Save tps2015gh/d3ea810b049be4869833ae4f008a9bef to your computer and use it in GitHub Desktop.
Save tps2015gh/d3ea810b049be4869833ae4f008a9bef to your computer and use it in GitHub Desktop.

#Demo/ Test Angular only

<!DOCTYPE html>
<html lang="en-US">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-init="pt=[1,2,3]" ng-controller="myCtrl" >
<p>Name : <input type="text" ng-model="name"></p>
<h1>Hello {{name}}</h1>
<table border="1" style="width:{{t.wi}};background-color:{{t.bgcolor}}" >
<tr ng-repeat=" x in links ">
<td>{{$index + 1 }}</td><td><a href='{{x.url}}'>{{x.text}}</a></td>
</tr>
</table>
<hr>
point = {{pt}} , point[2] = {{pt[2]}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.url = "test1.html";
$scope.text = "test1";
$scope.links = [
{text:"test1.html",url:"test1.html"}
,{text:"test2.html",url:"test2.html"}
,{text:"test3.html",url:"test3.html"}];
$scope.t = {wi: "200px" , bgcolor: "lightyellow" };
$scope.rid = 0 ;
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en-US">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl" >
<a href='{{backurl}}'>Back Page</a>
<h1>{{title}}</h1>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.backurl = "index.html";
$scope.title = "demo: select listbox ";
$scope.t = {wi: "200px" , bgcolor: "lightyellow" };
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment