私は$scope
でアクセス・ナビゲーションを行い、クリックに基づいて使用しました。私はURLをURLに設定できません。正しいURLはhttp://www.example.com/base/index
またはhttp://www.example.com/base/thread
、またはhttp://www.example.com/base/tag
です。 しかし、結果は常に 'http://www.example.com/base/indexでも、私は別のナビゲーションをクリックしました。
問題を検索したら、答えは$routeProvider
と$location
です。 $scope
と$ scope内にURLを設定することはできますか?
は、これは私のコードです:ところで
$scope.states = {};
$scope.states.activeItem = 'nav1';
$scope.items = [{
id: 'nav1',
target: 'home',
title: 'Home',
icon: 'fa fa-home fa-3x'
}, {
id: 'nav2',
target: 'thread',
title: 'Thread + Answer',
icon: 'fa fa-briefcase fa-3x'
}, {
id: 'nav3',
target: 'tag',
title: 'Tag',
icon: 'fa fa-briefcase fa-3x'
},
{
id: 'nav4',
target: 'trending_tag',
title: 'Trending Tag',
icon: 'fa fa-briefcase fa-3x'
},
{
id: 'nav5',
target: 'category',
title: 'Category',
icon: 'fa fa-briefcase fa-3x'
},
{
id: 'nav6',
target: 'user',
title: 'User',
icon: 'fa fa-user-circle-o fa-3x'
}];
$scope.callToAction = function(actionName){
if($scope[actionName]){
$scope[actionName]();
}else{
alert("YOUR PAGE NOT FOUND BECAUSE AKU BELUM BUAT PAGE NYA HEHE");
}
};
、$scope.items
私のナビゲーションを実行します。
作業? – SPViradiya
はい、そうです。しかし、私はその方法を使用する場合、URLを設定することに混乱しています。 – userpr