Angular 2 routing to a different page and calling a function while passing in a parameter -


what doing on table users clicks edit @ point id table row , need open edit user screen passing in userid "changeuser" function loads selected user.

i cannot work out how call function passing in parameter.

this code:

public oneditclicked(data: any): {   let myid = (this.users[data.index].id);   let name = this.users[data.index].first_name + ' ' + this.users[data.index].last_name ;   alert(`you clicked edit id: ${myid}, name ${name}`);    this.router.navigatebyurl('/manageuser', onchange(myid));  } 

thanks andy


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -