[ad_1]
I have a select filter with several options. I need it to load one or another option depending on whether the url changes. I think that with an ngif it could be achieved but I can’t see the way.
How can I do so that if I’m in one route or another of the view, I get some filter options or others?
Thanks.
html view
<select>
<ng-container *ngif="showOpen()">
<option value="">AllOptions</option>
<option value="">Receive</option>
<option value="">Send</option>
<option value="">News</option>
<option value="">Pending</option>
</ng-container>
<ng-container *ngif="showClose()">
<option value="">All Options</option>
<option value="">Cancel</option>
<option value="">Final</option>
</ng-container>
</select>
component.ts
showOpen (){
this.router.url.includes('open')
}
showClose (){
this.router.url.includes('close')
}
[ad_2]