5

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?

1 Answer 1

15

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)})"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.