Last active
October 3, 2018 17:02
-
-
Save DevEarley/142b80299f89e8162b25daa6a5bbee5c to your computer and use it in GitHub Desktop.
Your everyday app.js - with routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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