Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS : How to use $state.go to pass querystring in nested state routing

How can I use $state.go to pass a query string into nested state routing?

Code:

 .state('masterform', {
        url: "/masterform?action&assetId&contentTypeId&folderid",
                views: {
                    content: {
                        templateUrl: 'components/masterform/masterform.html',
                        controller: 'masterformCtrl as masterform'
                    }
                }
            })
            .state('masterform.access', {
                url: "/access",
                views: {
                    content: {
                        templateUrl: 'components/masterform/access/access.html',
                        controller: 'accessCtrl as access'
                    }
                }
            })

Thanks.

like image 694
Shashwat Tripathi Avatar asked Mar 10 '15 14:03

Shashwat Tripathi


1 Answers

You can simply pass query string parameters with second option of $state.go(). Like:

$state.go('masterform', {action:'Get', assetId:1234, folderId:999});
like image 98
Rubi saini Avatar answered Nov 18 '22 00:11

Rubi saini