Angular parameters not mandatory on the route

Asked

Viewed 828 times

1

I have a screen where I need to pass a parameter according to your call, IE, have calls that are not necessary to pass the parameter and have calls that are direct queries that are necessary to pass the parameter.

My question is how to do it if you do not want to pass the parameter (parameter is of the integer type, where I am passing 0 (zero)) so that it does not get the url and the value zeroed. example:

Parameter-less:

 http://localhost:9080/sc/#/logistica/requisicoes/0

With parameter:

http://localhost:9080/sc/#/logistica/requisicoes/2000936

My route:

.state('app.logistica.requisicoes', {
                    url: '/requisicoes/:id',
                    templateUrl: 'views/logistica-requisicoes.html',

I would like my URL when the parameter was not needed to be zero.

http://localhost:9080/sc/#/logistica/requisicoes
  • It worked @user11890, the answer

1 answer

1


Browser other questions tagged

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