Calling route from a button is not working

Asked

Viewed 343 times

1

I need, when I create an Operator, after creating, I should call another screen, the list of operators. It turns out that it is not working. The route is called Operator and how I put on that button?

<button type="submit" class="btn btn-primary">Criar</button>

I’ve tried it like this:

<button type="submit" class="btn btn-primary"><a routerLink="/operator"></a>Criar</button>

and so

<button type="submit" class="btn btn-primary" routerLink="/operator">Criar</button>

1 answer

2


The right way is this:

<button type="submit" class="btn btn-primary"><a routerLink="/operator">Criar</a></button>
  • I changed the ending of the </a> tag. The problem is that the value of the (Create) button was linked and consequently the text was almost invisible.

Browser other questions tagged

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