문제

I am building a Dashings dashboard and using font-awesome to display icons in a widget. I am trying to bind a dynamic class and a static class to one tag in the html such as

<i data-bind-class="item.icon icon-large"></i>

but obviously this isn't working. What is the correct way to do it so that both classes apply?

도움이 되었습니까?

해결책

Use Batman's append view filter. For example:

<i data-bind-class="item.icon | append ' icon-large'"></i>

Note that a string literal passed to append should be wrapped in quotes!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top