Skip to content

Instantly share code, notes, and snippets.

@dbarrionuevo
Created August 26, 2014 03:12
Show Gist options
  • Select an option

  • Save dbarrionuevo/d04532a101de655defb5 to your computer and use it in GitHub Desktop.

Select an option

Save dbarrionuevo/d04532a101de655defb5 to your computer and use it in GitHub Desktop.
<!-- Sin Alias -->
<div ng-controller="CustomersController">
<ul>
<li ng-repeat="customer in customers">
{{ customer.name }}
</li>
</ul>
</div>
<script>
function CustomersController ($scope) {
$scope.customers = [
{ name: 'John Doe' }.
{ name: 'Jane Juarez' }
];
}
</script>
<!-- Con Alias -->
<div ng-controller="CustomersController as ctrl">
<ul>
<li ng-repeat="customer in ctrl.customers">
{{ customer.name }}
</li>
</ul>
</div>
<script>
function CustomersController () {
this.customers = [
{ name: 'John Doe' }.
{ name: 'Jane Juarez' }
];
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment