Switch to a different page using parameters by
$scope.singlepage = function($url) {
$url;
console.log($url);
$state.go('app.paymentinfo', { "userId": $url});
};
Include state and State param here
angular.module('app.feedback').controller('singleCourseFeedbackCtrl', ['feedbackApiSet','$scope','$state','$stateParams','httpService','fileReader',
function(feedbackApiSet,$scope, $stateParams, $state,httpService,fileReader){
However, in my code $stateParams and $state got mixed up
When I corrected it like this:
The code is not functioning properly. I get an error in the console saying cannot read property '' of undefined state param
angular.module('app.feedback').controller('singleCourseFeedbackCtrl', ['feedbackApiSet','$scope','$stateParams','$state','httpService','fileReader',
function(feedbackApiSet,$scope, $stateParams, $state,httpService,fileReader){
How can I retrieve params
$scope.showprofile = $stateParams.params.userId;
My module state looks like this:
.state ('app.singleCourseFeedback', {
url : '/singleCourseFeedback/:userId',
templateUrl : 'modules/feedback/views/singleCourseFeedback.html',
controller : 'singleCourseFeedbackCtrl'
})
Why does everything work when written incorrectly?