Skip to content

Instantly share code, notes, and snippets.

@sphingu
Created February 18, 2014 11:56
Show Gist options
  • Save sphingu/255a3acd38d2b2049cf0 to your computer and use it in GitHub Desktop.
Save sphingu/255a3acd38d2b2049cf0 to your computer and use it in GitHub Desktop.
FirstAngularApp
<html ng-app >
<head>
<title>First Application</title>
<!--<script type="text/javascript" src="jquery-1.10.2.js"></script>-->
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript">
function AlbumController($scope) {
$scope.images = [
{ "thumbnail": "img/1.png", "description": "Bootstrap MVC" },
{ "thumbnail": "img/2.png", "description": "Happy Holiday" }
];
}
</script>
</head>
<body>
<div data-descript="ExampleOne Without any controller for Two Way Binding">
<label>Name :</label>
<input type="text" ng-model="yourName" placeholder="Enter Your Name Here" />
<hr />
<pre>Hello, {{yourName}}</pre>
</div>
<div ng-controller="AlbumController">
<ul>
<li ng-repeat="image in images | filter : description=yourName">
<img alt="{{image.description}}" src="{{image.thumbnail}}" height="30" />
</li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment