Last active
August 29, 2015 14:05
-
-
Save srph/171b9ee7a0af1a412a5e to your computer and use it in GitHub Desktop.
Leading / on urls
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
app.config([ | |
'$stateProvider', | |
function($stateProvider) { | |
var state = { | |
name: 'login', | |
url: '/login', | |
// resolve: { | |
// guest: ['AuthSrvc', function(AuthSrvc) { | |
// return AuthSrvc.guest(); | |
// }] | |
// } | |
templateUrl: '/app/components/login/template.html', | |
data: { | |
pageTitle: 'Login' | |
}, | |
controller: 'LoginCtrl' | |
}; | |
$stateProvider.state(state); | |
} | |
]); |
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
app.config([ | |
'$stateProvider', | |
function($stateProvider) { | |
var state = { | |
name: 'logout', | |
url: '/logout', | |
data: { | |
pageTitle: 'Logout' | |
}, | |
resolve: { | |
logout: ['AuthSrvc', function(AuthSrvc) { | |
AuthSrvc | |
.logout | |
.then(function() { | |
$window.location.href = '/login'; | |
}); | |
}] | |
} | |
}; | |
$stateProvider.state(state); | |
} | |
]); |
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
app.config([ | |
'$stateProvider', | |
function($stateProvider) { | |
var state = { | |
name: 'main.holiday', | |
url: 'holiday', | |
data: { | |
pageTitle: 'Manage Holidays' | |
}, | |
resolve: { | |
holidays: ['HolidaySrvc', function(HolidaySrvc) { | |
var year = new Date().getFullYear(); | |
return HolidaySrvc.get(year); | |
}] | |
}, | |
templateUrl: '/app/components/main/holiday/template.html', | |
controller: 'HolidayCtrl' | |
}; | |
$stateProvider.state(state); | |
} | |
]); |
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
app.config([ | |
'$stateProvider', | |
function($stateProvider) { | |
var state = { | |
name: 'main.home', | |
url: '', | |
templateUrl: '/app/components/main/home/template.html', | |
data: { | |
pageTitle: 'Dashboard' | |
}, | |
// resolve: { | |
// } | |
}; | |
$stateProvider.state(state); | |
} | |
]); |
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
app.config([ | |
'$stateProvider', | |
function($stateProvider) { | |
var state = { | |
name: 'main', | |
abstract: true, | |
url: '/', | |
templateUrl: '/app/components/main/template.html' | |
}; | |
$stateProvider.state(state); | |
} | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment