Skip to content

Instantly share code, notes, and snippets.

@atmimran
Created January 25, 2015 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atmimran/6435ceaa5fa3eb67af45 to your computer and use it in GitHub Desktop.
Save atmimran/6435ceaa5fa3eb67af45 to your computer and use it in GitHub Desktop.
view scope and controller
<!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