Created
January 25, 2015 14:44
-
-
Save atmimran/6435ceaa5fa3eb67af45 to your computer and use it in GitHub Desktop.
view scope and controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app=""> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<div class="container" data-ng-controller="simpleController"> | |
<h3>Adding A Simple Controller</h3> | |
<ul> | |
<li data-ng-repeat="cust in customers"> | |
{{cust.name}} - {{cust.city}} | |
</li> | |
</ul> | |
</div> | |
<script type="text/javascript"> | |
function simpleController($scope) { | |
$scope.customers = [ | |
{ name: 'Muhammad', city: 'Madina' }, | |
{ name: 'Imran', city: 'Karachi' }, | |
{ name: 'Ali', city: 'Khi' } | |
]; | |
} | |
</script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment