javascript - A string prefix in ng-class -


ng-class="{{'tabs-'+currentstyle.value}}"  ng-class="'tabs-'{{currentstyle.value}}"  ng-class="tabs-{{currentstyle.value}}" 

i trying apply class based on value, tried of above , get

error: [$parse:syntax] syntax error: token 'undefined' not primary expression @ column null of expression [tabs-] starting @ [tabs-]. 

what doing wrong?

i want result class="tabs-currentstyle.value" without having declare variable in scope

probably trying this:

ng-class="{true:'tabs-'+currentstyle.value}[true]" 

here online demo


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -