-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Angular (not working) & Routing changes (To be changed)
- Loading branch information
Showing
33 changed files
with
340 additions
and
265 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
function AuthConfig($stateProvider, $httpProvider) { | ||
'ngInject'; | ||
'ngInject'; | ||
|
||
// Define the routes | ||
$stateProvider | ||
// Define the routes | ||
$stateProvider | ||
.state('app.login', { | ||
url: '/login', | ||
controller: 'AuthCtrl as $ctrl', | ||
templateUrl: 'auth/auth.html', | ||
title: 'Sign in', | ||
resolve: { | ||
auth: function (User) { | ||
return User.ensureAuthIs(false); | ||
} | ||
} | ||
}) | ||
|
||
.state('app.login', { | ||
url: '/login', | ||
controller: 'AuthCtrl as $ctrl', | ||
templateUrl: 'auth/auth.html', | ||
title: 'Sign in', | ||
resolve: { | ||
auth: function(User) { | ||
return User.ensureAuthIs(false); | ||
} | ||
} | ||
}) | ||
.state('app.register', { | ||
url: '/register', | ||
controller: 'AuthCtrl as $ctrl', | ||
templateUrl: 'auth/auth.html', | ||
title: 'Sign up', | ||
resolve: { | ||
auth: function (User) { | ||
return User.ensureAuthIs(false); | ||
} | ||
} | ||
}); | ||
|
||
.state('app.register', { | ||
url: '/register', | ||
controller: 'AuthCtrl as $ctrl', | ||
templateUrl: 'auth/auth.html', | ||
title: 'Sign up', | ||
resolve: { | ||
auth: function(User) { | ||
return User.ensureAuthIs(false); | ||
} | ||
} | ||
}); | ||
|
||
}; | ||
} | ||
; | ||
|
||
export default AuthConfig; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import authInterceptor from './auth.interceptor'; | ||
|
||
function AppConfig($httpProvider, $stateProvider, $locationProvider, $urlRouterProvider) { | ||
'ngInject'; | ||
|
||
$httpProvider.interceptors.push(authInterceptor); | ||
'ngInject'; | ||
|
||
/* | ||
If you don't want hashbang routing, uncomment this line. | ||
Our tutorial will be using hashbang routing though :) | ||
*/ | ||
// $locationProvider.html5Mode(true); | ||
$httpProvider.interceptors.push(authInterceptor); | ||
|
||
$stateProvider | ||
.state('app', { | ||
abstract: true, | ||
templateUrl: 'layout/app-view.html', | ||
resolve: { | ||
auth: function(User) { | ||
return User.verifyAuth(); | ||
} | ||
} | ||
}); | ||
/* | ||
If you don't want hashbang routing, uncomment this line. | ||
Our tutorial will be using hashbang routing though :) | ||
*/ | ||
// $locationProvider.html5Mode(true); | ||
|
||
$urlRouterProvider.otherwise('/'); | ||
$stateProvider | ||
.state('app', { | ||
abstract: true, | ||
templateUrl: 'layout/app-view.html', | ||
resolve: { | ||
auth: function (User) { | ||
return User.verifyAuth(); | ||
} | ||
} | ||
}); | ||
|
||
$urlRouterProvider.otherwise('/'); | ||
|
||
} | ||
|
||
export default AppConfig; | ||
export default AppConfig; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
const AppConstants = { | ||
//api: 'http://localhost:3000/api', | ||
api: 'https://conduit.productionready.io/api', | ||
jwtKey: 'jwtToken', | ||
appName: 'Conduit', | ||
appName: 'EvilDraw', | ||
}; | ||
|
||
export default AppConstants; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
function AppRun(AppConstants, $rootScope) { | ||
'ngInject'; | ||
'ngInject'; | ||
|
||
// change page title based on state | ||
$rootScope.$on('$stateChangeSuccess', (event, toState) => { | ||
$rootScope.setPageTitle(toState.title); | ||
}); | ||
// change page title based on state | ||
$rootScope.$on('$stateChangeSuccess', (event, toState) => { | ||
$rootScope.setPageTitle(toState.title); | ||
}); | ||
|
||
// Helper method for setting the page's title | ||
$rootScope.setPageTitle = (title) => { | ||
$rootScope.pageTitle = ''; | ||
if (title) { | ||
$rootScope.pageTitle += title; | ||
$rootScope.pageTitle += ' \u2014 '; | ||
} | ||
$rootScope.pageTitle += AppConstants.appName; | ||
}; | ||
// Helper method for setting the page's title | ||
$rootScope.setPageTitle = (title) => { | ||
$rootScope.pageTitle = ''; | ||
if (title) { | ||
$rootScope.pageTitle += title; | ||
$rootScope.pageTitle += ' \u2014 '; | ||
} | ||
$rootScope.pageTitle += AppConstants.appName; | ||
}; | ||
|
||
} | ||
|
||
export default AppRun; | ||
export default AppRun; |
Oops, something went wrong.