Suppose if we have to modify or do some prepossessing on parameters of ui-sref like below:
ui-sref="post({postId: post.post_id, postTitle: post.post_title | myFilter )})"
As shown if I want to apply my custom filter to parameter, is there any way to it?
I have tried like above, but it didn't worked and was giving syntax color.
The other solution could be probably to modify attribute in controller
only, but that it not feasible for me, as these data is coming from server in list and I don't think to pre-process it in controller is good idea just for this.
Any suggestions this can be achieved?
Yes you can, however you need to wrap each parameter in parenthesis like so:
ui-sref="post({postId: (post.post_id | myFilter), postTitle: (post.post_title | myFilter)})"
Example, using lowercase filter:
ui-sref="post({postId: (post.post_id | lowercase), postTitle: (post.post_title | lowercase)})"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With