<div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
<p *ngIf="true">show</p>
<p *ngIf="isShow">hide</p>
<p template="ngIf true">这是 ngIF 判断是否显示</p> <ul [ngSwitch]="status">
<li *ngSwitchCase="1">已支付</li>
<li *ngSwitchCase="2">订单已经确认</li>
<li *ngSwitchCase="3">已发货</li>
<li *ngSwitchDefault>无效</li>
</ul>
</div>
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'angulardemo';
status='2';
isShow=false;
}

效果:

最新文章

  1. 2.Powershell Console
  2. vim下打造python编辑器
  3. WebBrowser处理AJAX生成的网页内容!
  4. B站运维团队成长的血泪史
  5. Sqoop增量从MySQL中向hive导入数据
  6. 用 React 编写SVG图表
  7. WinForm使用webbrowser爬取数据,中文乱码问题
  8. JZ2440开发笔记(1)——arm-linux-gcc环境搭建
  9. hdu 2955 Robberies 背包DP
  10. Android 原生listview item伸展收缩效果 (续)
  11. Python魔法方法总结及注意事项
  12. OI回忆录——一个过气OIer的智障历程
  13. Python开发【第三篇】基本数据类型
  14. Thread类相关方法
  15. python面试题(一)
  16. Ubuntu18.04和OpenWrt 18.06.0 下使用aria2和BaiduExport处理百度盘下载
  17. O_NONBLOCK与O_NDELAY有何不同?
  18. PowerShell----Automatic_Variables(预定义变量)
  19. Raw-OS源代码分析之idle任务
  20. php-fpm 操作命令

热门文章

  1. Django中实现单表和多表接口
  2. 【开200数组解决二叉搜索树的建立、遍历】PAT-L3-016. 二叉搜索树的结构——不用链表来搞定二叉搜索树
  3. Mac系统上,Firefox和Selenium不兼容的情况
  4. LG3690 【模板】Link Cut Tree 和 SDOI2008 洞穴勘测
  5. PL/SQL块与表达式
  6. 2019HDU多校第九场 Rikka with Quicksort —— 数学推导&amp;&amp;分段打表
  7. waitgroup等待退出
  8. imp
  9. 洛谷P1016 旅行家的预算 题解
  10. linux系列(一):ls命令