Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Negative Balance in Red
Message
General information
Forum:
Javascript
Category:
Other
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01608940
Message ID:
01608997
Views:
24
>>
>>I'd like to show balance in red when negative.
>>
>
>>
>>I'll check with project manager first.
>
>The thread you linked to includes part of the answer - if you don't want parens, create your own filter. Yeah, it'd be nice if this was easier to configure.
>
>For setting it to red, look at ng-class. Create a CSS style with the colors you want. I'd wrap the {{}} stuff in something like a span tag. Add the ng-class attribute to the span and use an expression to set the class to your CSS class, something like this might work (remove the extra space I needed to add to the span tags to get this to appear here):
>
>
>< span ng-class="{'negative' : currentAccount.totalBalance < 0}">{{currentAccount.totalBalance}}< /span>
>
Very nice!
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform