Reputation: 421
I have this code:
<a ui-sref="contacts({ type: contact.type })">Joe</a>
Which says "get the contacts that type = contact.type. So in the url I would pass a param contacts/friends and it would give me a list of contacts with type "friends"
is there any way that I can say this: "get the contacts that type != contact.type"
meaning, if i pass a param contacts/friends to show results with all contacts that do not have type "friends"
I've tried several variations of this:
<a ui-sref="contacts({ type != contact.type })">Joe</a>
with no result.
does anyone know if that's possible?
Upvotes: 0
Views: 104
Reputation: 678
Params are there to pass data, not to do database query.
If you want to get all contacts that are not of type A, make a REST request/DB query or whatever way you use to fetch data, and use the recieved 'type' param as part of it. for example:
SELECT * FROM contacts where Type != {type}
Upvotes: 0
Reputation: 1145
ui-sref
should not be used to pass params to the state. use stateParams
to do this.
Upvotes: 0