标签:检查 student name 感叹号 undefined pre code efi fine
stu2: Student = {
id: 1,
name: undefined,
age: 3
};
<h1>stu2 name {{stu2!.name}}</h1> // stu2 name
<h1>stu2 id {{stu2!.id}}</h1> // stu2 id 1
stu3: Student;
<h1>stu3 id{{stu3?.id}}</h1> // stu3 id
<h1>stu3 name{{stu3?.name}}</h1> // stu3 name
标签:检查 student name 感叹号 undefined pre code efi fine
原文地址:https://www.cnblogs.com/Godfunc/p/9844791.html