0
ユーザーがログインした後、私は彼に "Hello" +彼の名前が書かれたページを見ることを望みます。 ページに彼をリダイレクトするために、私はこれを使用しています:angularjsを持つ特定のウェルカムページにユーザーを転送
angular.
module('myApp').
config(['$locationProvider', '$routeProvider',
function($locationProvider, $routeProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.
when('/loginPage',{
template: '<login-page></login-page >'
}).
when('/user-issue', {
resolve: {
"check":function($location,$rootScope){
if(!$rootScope.stat){
$location.path('/');
}
}
},
template: '<user-issue></user-issue>'
}).
otherwise({redirectTo: '/loginPage'});
}]);
にはどうすればloginPage.jsからuserIssue.jsページへの彼の名前の値を渡すことができますか? LoginPageで$ rootScope.usernameを使ってuserIssueに持ってきましたが、これは動作しません。