Skip to content

Instantly share code, notes, and snippets.

@blaisethomas
Created January 28, 2015 16:21
Show Gist options
  • Save blaisethomas/e1efe047dc7974a95515 to your computer and use it in GitHub Desktop.
Save blaisethomas/e1efe047dc7974a95515 to your computer and use it in GitHub Desktop.
Consider this code being found in the controller:
$scope.stuff = ["a", "b", "c", "d"];
$scope.changeIt = function(idx) {
$scope.stuff[idx] = "x";
};
And this unordered list on the page:
<ul>
<li ng-repeat="letter in stuff track by $index" ng-bind="letter" ng-click="changeIt($index);"></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment