Skip to content

Instantly share code, notes, and snippets.

@JosephShering
Created May 27, 2014 19:32
Show Gist options
  • Save JosephShering/8b856503f76d3b62ee7f to your computer and use it in GitHub Desktop.
Save JosephShering/8b856503f76d3b62ee7f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<title>This is a test</title>
<script src="assets/js/angular.min.js"></script>
</head>
<body>
<div ng-controller="MainController">
<input type="text" ng-model="name" />
<ul>
<li ng-repeat="person in people | filter : name">
{{ person.name }}
</li>
</ul>
<div>
<script>
var app = angular.module('myapp', ['ngRoute']);
app.controller("MainController", function($scope){
$scope.understand = "You need to understand something";
$scope.people = [
{ name: 'John' },
{ name: 'Avery'},
{ name: 'Dorn' }
];
});
app.config(function($route, $location){
$route
.when('/',
{
controller : 'MainController',
templateUrl : 'assets/index.html'
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment