Receive parameters in $state

Asked

Viewed 360 times

0

In the app.config I have the following $state:

.state('app.users.edit', {
            url: "/editar/:uid",              
            views: { 
                'content@' : {
                    templateUrl: 'view/users_edit.html',
                    controller: 'users_edit',
                    resolve: { auth : logged }
                }
            }
        });

I have a list of all users, the edit button was configured as follows:

<a href="#" ui-sref="app.users.edit">Editar ID {{user.id}}</a>

I am unable to pass user ID to $state.

How do I receive parameters in $state?

1 answer

2

You have to pass the parameters like this:

ui-sref="app.users.edit({ uid: 'parâmetro' })"

as if calling a function and passing it a map with the parameter name and value.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.