Hi,

ngClass will helps you achieve this requirement.

On Sun 2 Feb, 2020, 6:45 AM ahmed elbarbary, <ahmedsa.aziz...@gmail.com>
wrote:

> I already have web api function do count for parts related to product
> based on name of product pass to it
>
> suppose I pass car to web api function
>
> then it will return how many parts exist on product table  that car
> contain it
>
> so if product table have many parts on table product then count will be
> bigger from 0
>
> then it will show count as green
>
> and if is count equal 0 then it will count returned as red for product
>
> so my url return integer value as 5 represent number of parts for product
>
> and may be 0 that mean no parts for product
>
> How to display count by color green if count more than 0
> and red if less than 0
>
> How to write service and component.ts and component view by angular 7
>
> service
> localhost:5050/api/countparts/Car it will return integer value
> component.ts
> how to display returned value when bigger than 0 then green else equal
> then red
> on component.html
> 5 green
> 0 red
>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to angular+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/angular/7ef16591-4870-474e-a968-f2fe242f72bb%40googlegroups.com
> <https://groups.google.com/d/msgid/angular/7ef16591-4870-474e-a968-f2fe242f72bb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CAOY5K4nUQ7gck8YyksYCkvCYi28M-veZC2VNuixm61jFaeenYg%40mail.gmail.com.

Reply via email to