knockout.punches
knockout.punches copied to clipboard
Possibility to access enclosing element in text filter?
Basically I want the same behavior of the "| default: " filter but I have the need to make the text italics when it should display "Missing". Still want HTML escape and so on though. Would it be possible to access the enclosing element to attach a class or a style to it?
Perhaps it could be built in, but you can always pass the element to the filter: text: field | filter:$element
Thank you!
I was not aware of that opportunity.
It works, but not having to pass it in for every use would have been nice... :)
text: field | missing