angularjsangular-ui-routerangular-ui-router-extras

Apply angular filter on ui-router url params


I want to apply some filter on url params. for example:

ui-sref="stateName({slug:{{someobj.slug | someFilter}}})"

how can I apply this?


Solution

  • you dont need interpolate expressions inside ui-sref. Just enclose the to-be-filtered expression inside round brackets:

    ui-sref="stateName({slug: (someobj.slug | someFilter)})"