gihan gihan - 7 months ago 53
Javascript Question

ng-if doesn't work if condition text contains space in AngularJs

I was trying to set values into Angular js Ui grid based on the row.entity values.To do that i have created cellTemplate that check the row values and based on values i did some text styling.

Code Snippet

var statusTemplate='<div>
<span class="txt-color-yellow""Draft">{{}}</span>
<span class="txt-color-orange"[
"AwaitingReview"]>{{}} </span><span
</span><span class="txt-color-blue"[ "Ready ForScripting"]>{{}}</span><span
class="txt-color-brown"[ "Awating
class="txt-color-green"[ "ScriptReviewed"]>{{}}</span><span


But the problem was in
when trying to check text values with spaces it throws an exception saying
Unterminated quote at columns 25-34 ["Awaiting] in expression [["Awaiting]. etc...

Please let me know how can i check the text with spaces in ng-if.


Change it in all div where write like string pass in the single '' and condition write in double quote ""