i can’t get param values through $stateParams, what i get is always undefined. Is there any mistake in the below codes?
the controllers codes:
.controller('DywzCtrl', function ($scope, $state) {
$scope.queryWeizhang = function () {
$state.go("tabs.result", {a:1, b:2});
}
})
.controller('ResultCtrl', function ($scope, $stateParams) {
alert($stateParams.a);
})
the stateProvider:
$stateProvider
.state('tabs', {
url: "/tab",
abstract: true,
templateUrl: "tabs.html"
})
.state('tabs.search', {
url: "/search",
views: {
'search-tab': {
controller: 'DywzCtrl',
templateUrl: "search.html"
}
}
})
.state('tabs.result', {
url: "/result",
views: {
'search-tab' :{
templateUrl: "result.html",
controller: 'ResultCtrl'
}
}
})
});