Skip to content

Instantly share code, notes, and snippets.

@SpencerCooley
Created December 1, 2013 21:57
Show Gist options
  • Save SpencerCooley/7741374 to your computer and use it in GitHub Desktop.
Save SpencerCooley/7741374 to your computer and use it in GitHub Desktop.
var demoApp = angular.module('demoApp', ['ngRoute']);
demoApp.controller('mainController', function($scope){
$scope.customers = [
{name: "hello", location: "world"},
{name: "hello2", location: "world1"},
{name: "hello3", location: "world2"},
{name: "hello4", location: "world3"},
{name: "hello5", location: "world4"}
]
})
demoApp.config(function($routeProvider){
$routProvider
.when('/', {controller: 'mainController', templateUrl: '/partials/test.html'})
.when('/hello', {controller: 'mainController', templateUrl: '/partials/test.html'})
.otherwise({redirectTo: '/'});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment