Skip to content

Instantly share code, notes, and snippets.

@pcote
Last active August 23, 2016 14:39
Show Gist options
  • Select an option

  • Save pcote/0794d4a56655a9509af6f0912ac72f5e to your computer and use it in GitHub Desktop.

Select an option

Save pcote/0794d4a56655a9509af6f0912ac72f5e to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<title>AngularJS looping example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.min.js"></script>
</head>
<body>
<div ng-app="app" ng-controller="controller">
<ul>
<li ng-repeat="word in words">{{word}}</li>
</ul>
</div>
<script>
var controller = function($scope){
$scope.words = "This is my list of words".split(" ");
};
angular.module("app", [])
.controller("controller", controller);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment