状态参数工作不正确
State Params work incorrectly
通过
移动到带有参数的另一页
$scope.singlepage = function($url) {
$url;
console.log($url);
$state.go('app.paymentinfo', { "userId": $url});
};
添加状态和状态参数
angular.module('app.feedback').controller('singleCourseFeedbackCtrl', ['feedbackApiSet','$scope','$state','$stateParams','httpService','fileReader',
function(feedbackApiSet,$scope, $stateParams, $state,httpService,fileReader){
但在我的代码 $stateParams 中,$state 混淆了
当我得到这样的正确代码时:
我的代码不工作。控制台出错无法读取未定义状态参数属性''
angular.module('app.feedback').controller('singleCourseFeedbackCtrl', ['feedbackApiSet','$scope','$stateParams','$state','httpService','fileReader',
function(feedbackApiSet,$scope, $stateParams, $state,httpService,fileReader){
我如何获取参数 $scope.showprofile = $stateParams.params.userId;
我在模块中的状态:
.state ('app.singleCourseFeedback', {
url : '/singleCourseFeedback/:userId',
templateUrl : 'modules/feedback/views/singleCourseFeedback.html',
controller : 'singleCourseFeedbackCtrl'
})
如果他们写错了,为什么所有的都有效?
只使用 $stateParams.userId;
不带参数。
通过
移动到带有参数的另一页$scope.singlepage = function($url) {
$url;
console.log($url);
$state.go('app.paymentinfo', { "userId": $url});
};
添加状态和状态参数
angular.module('app.feedback').controller('singleCourseFeedbackCtrl', ['feedbackApiSet','$scope','$state','$stateParams','httpService','fileReader',
function(feedbackApiSet,$scope, $stateParams, $state,httpService,fileReader){
但在我的代码 $stateParams 中,$state 混淆了
当我得到这样的正确代码时:
我的代码不工作。控制台出错无法读取未定义状态参数属性''
angular.module('app.feedback').controller('singleCourseFeedbackCtrl', ['feedbackApiSet','$scope','$stateParams','$state','httpService','fileReader',
function(feedbackApiSet,$scope, $stateParams, $state,httpService,fileReader){
我如何获取参数 $scope.showprofile = $stateParams.params.userId;
我在模块中的状态:
.state ('app.singleCourseFeedback', {
url : '/singleCourseFeedback/:userId',
templateUrl : 'modules/feedback/views/singleCourseFeedback.html',
controller : 'singleCourseFeedbackCtrl'
})
如果他们写错了,为什么所有的都有效?
只使用 $stateParams.userId;
不带参数。