2 Angular-系统指令、自定义指令ngIf


1 项目结构

 2 myc01.component.ts

 1 import { Component, OnInit } from '@angular/core';
 2 
 3 @Component({
 4   selector: 'app-myc01',
 5   templateUrl: './myc01.component.html',
 6   styleUrls: ['./myc01.component.css']
 7 })
 8 export class Myc01Component implements OnInit {
 9 
10   score = 50;
11 
12   constructor() { }
13 
14   ngOnInit(): void {
15   }
16 
17 }
myc01.component.ts

3 myc01.component.html

 1 

myc01 works!

2

成绩:{{score}}

3
优秀
4
良好
5
及格
6 7 8 9 10 及格 11 12 13 14 不及格 15
myc01.component.html

4 效果