Else statement in Angular

前端 未结 4 692
有刺的猬
有刺的猬 2021-01-03 23:00

How does angular2 propose to render

{{todo.title}}

in case if unf

4条回答
  •  醉梦人生
    2021-01-03 23:28

    Syntax compatible with Angular 4.0 and beyond

    
      Content displayed if expression returns false
    
    
      Content displayed if expression returns true
    
    

    or

    
    
      Content displayed if expression returns true
    
    
      Content displayed if expression returns false
    
    

    Syntax compatible with Angular 2.0 and beyond

    
        true
    
    
        else
    
    

    Important

    • You can use e.g.

      , or any other tag, instead of