すべてのユーザーに個別のページが必要な角度のアプリを作成しています。以下角度jsのURLにidを追加する
localhost/{username}
app.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl : '../../views/index_old.html',
})
.when('/email/signup', {
templateUrl : '../../views/emailsignup.html',
controller : 'myCont'
})
.when('/email/code/', {
templateUrl : '../../views/emailcode.html',
controller : 'codeCheck'
})
.when('/user/basic/', {
templateUrl : '../../views/basicInfo.html',
controller : 'userbasicInfo'
})
.when('/user/location/', {
templateUrl : '../../views/userLocation.html',
controller : 'userLocation'
})
});
私はURLでユーザー名を渡すことができませんよ、私のルーティングのparamです。 これを行う方法はありますか?
あなたはパラメータとしてユーザー名を渡すことを意味しますか? –
はい、about.meサイトのようなものが必要です。 about.me/ashishverma〜ここで、ashishverma〜はユーザー名です –