Skip to content

Instantly share code, notes, and snippets.

@spacerockzero
Created November 22, 2013 17:07
Show Gist options
  • Save spacerockzero/7603382 to your computer and use it in GitHub Desktop.
Save spacerockzero/7603382 to your computer and use it in GitHub Desktop.
Angular new app template
'use strict';
var app = angular.module("myApp", ['ngRoute']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {
templateUrl: 'partials/home.html',
controller: 'HomeCtrl'
});
$routeProvider.when('/services', {
templateUrl: 'partials/services.html',
controller: 'ServicesCtrl'
});
$routeProvider.when('/clients', {
templateUrl: 'partials/clients.html',
controller: 'ClientsCtrl'
});
}]);
app.controller('HomeCtrl', ['$scope', function($scope){
$scope.message = 'Welcome to Inspire';
}]);
app.controller('ServicesCtrl', ['$scope', function($scope) {
$scope.message = 'Everyone come and see how good I look!';
}]);
app.controller('ClientsCtrl', ['$scope', function($scope) {
$scope.message = 'These are clients';
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment