Receive parameters in $ state

0

In 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 with all users, the edit button has been set up as follows:

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

I am not able to pass the user ID to $ state.

How do I get parameters in $ state?

    
asked by anonymous 20.11.2014 / 13:33

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.

    
23.11.2014 / 17:14