angular2 template - Angular 2: If value exists show html -


at moment have service pulls values number of apis have written. in template wish output following html if value exists or not empty in results when fed template:

<li class="title rh-blue-lite-fg">{{ project.meta_header_one }}</li> 

so trying figure out how wrap in ngif or there other way 'li' item gets output if value present , not empty

i think can use ngif directive check if project isn't null:

<li class="title rh-blue-lite-fg" *ngif="project.meta_header_one">{{ project.meta_header_one }}</li> 

reference: https://angular.io/docs/ts/latest/api/common/index/ngif-directive.html


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -