Skip to content

Instantly share code, notes, and snippets.

@niisar
Created February 8, 2016 14:30
Show Gist options
  • Select an option

  • Save niisar/7958e1a6d82f72f3b9c8 to your computer and use it in GitHub Desktop.

Select an option

Save niisar/7958e1a6d82f72f3b9c8 to your computer and use it in GitHub Desktop.
AngularJSAuthentication.WEB
define(['route'], function () {
var app = angular.module('app', ['ui.router', 'ngStorage']);
app.init = function () {
angular.bootstrap(document, ['app']);
}
app.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/home");
$stateProvider
.state("login", {
url: "/login",
templateUrl: "views/login.html",
controller: 'loginCtrl'
})
.state("signup", {
url: "/signup",
templateUrl: "views/signup.html",
controller:"signupCtrl"
})
.state("order", {
url: "/order",
templateUrl: "views/order.html",
controller: "orderCtrl",
})
.state("home", {
cache:false,
url: "/home",
templateUrl: "views/home.html",
controller:"homeCtrl"
})
})
app.constant('cnst', {
serviceBase: "http://localhost:55390/"
});
//app.run(function ($localStorage) {
// //var authData = $localStorage.authorizationData;
// //if (authData) {
// //}
//});
app.config(function ($httpProvider) {
$httpProvider.interceptors.push('authInterceptorService');
})
return app;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment