uhlryk / angular-dynamic-number

Highly customizable angular directive for numbers
64 stars 32 forks source link

awnum:price is not working with filter on angular expressions #26

Closed jsbimra closed 8 years ago

jsbimra commented 8 years ago

Hi,

I am trying to use custom strategy to format using filter option, but its not working. Using following way {{100000:awnum:price}} also tried with below: {{100000:awnum}}

It working fine with input field not with angular expression.

Any help appreciated.

Thanks.

uhlryk commented 8 years ago

Hi Thank you for your feedback. Please check how it works in examples: https://github.com/uhlryk/angular-dynamic-number/blob/master/examples/index.html#L179 and there is working demo for examples. Above code is the last example here http://htmlpreview.github.io/?https://github.com/uhlryk/angular-dynamic-number/blob/master/examples/index.html You should use it like this: {{model|awnum:price}} <- use | instead of : after model Im not sure if you can use value as expression (for sure it works for models).

Please give me feedback if my comment help you.

jsbimra commented 8 years ago

Hi,

Sorry i was using pipe in my code like {{100000|awnum:price}} but while commenting here i made a mistake. But I found the gotcha, also was missing single quote around strategy name . {{100000|awnum: 'price'}} Now it worked.

Thanks a lot for reference and pointing.

uhlryk commented 8 years ago

Thanks, I close this ticket.