Angularjs 向嵌套管线传递参数
我正在开发一款angular应用程序,并尝试实现以下路线:Angularjs 向嵌套管线传递参数,angularjs,Angularjs,我正在开发一款angular应用程序,并尝试实现以下路线: /networks /network/nameofnetwork /network/nameofnetwork/shows /network/nameofnetwork/show/nameofshow 我的问题是,我可以访问所有路由,但唯一被调用的状态参数是网络名称,而不是显示。这是我的模块: angular.module('network',[]) .config(['$stateProvider',function($st
/networks
/network/nameofnetwork
/network/nameofnetwork/shows
/network/nameofnetwork/show/nameofshow
我的问题是,我可以访问所有路由,但唯一被调用的状态参数是网络名称,而不是显示。这是我的模块:
angular.module('network',[])
.config(['$stateProvider',function($stateProvider){
$stateProvider
.state('networks',{
url: '/networks',
templateUrl:'/templates/network/networks.tpl.html',
controller: 'ViewNetworksCtrl'
})
.state('network',{
url: '/network/:username',
templateUrl:'/templates/network/network.tpl.html',
controller: 'ViewNetworkCtrl'
})
.state('network.schedule',{
url: '/schedule',
templateUrl:'/templates/network/schedule.tpl.html',
controller: 'NetworkScheduleCtrl'
})
.state('network.shows',{
url: '/shows',
templateUrl:'/templates/network/shows.tpl.html',
controller: 'NetworkShowsCtrl'
})
.state('network.show',{
url: '/show/:slug',
templateUrl:'/templates/network/show.tpl.html',
controller: 'NetworkShowCtrl'
});
}])
.controller('ViewNetworksCtrl',['$scope',function($scope){}])
.controller('ViewNetworkCtrl',['$scope','$stateParams',function($scope, $stateParams){
console.log($stateParams);
}])
.controller('NetworkScheduleCtrl',['$scope',function($scope){}])
.controller('NetworkShowsCtrl',['$scope',function($scope){}])
.controller('NetworkShowCtrl',['$scope','$stateParams',function($scope, $stateParams){
console.log($stateParams);
}]);
通过在IRC频道聊天,我发现我错过了一个节目