Skip to content

Instantly share code, notes, and snippets.

@DevEarley
Last active October 3, 2018 17:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevEarley/142b80299f89e8162b25daa6a5bbee5c to your computer and use it in GitHub Desktop.
Save DevEarley/142b80299f89e8162b25daa6a5bbee5c to your computer and use it in GitHub Desktop.
Your everyday app.js - with routing
angular.module('myApp', ['ngRoute']).config(function ($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'content/views/login/login.html',
controller: 'loginController',
controllerAs: 'vm'
})
.when('/home', {
templateUrl: 'content/views/landing/landing.html',
controller: 'landingController',
controllerAs: 'vm'
});
$locationProvider.html5mode = true;
}).run(function ($rootScope, $http, $location) {
$http.defaults.url = "localhost:1234";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment