随笔分类 - Angular
摘要:1 代码结构 2 myc04.component.html <p>myc04 works!</p> <!--emit():触发msgEvent中的函数,就是show()--> <button (click)="msgEvent.emit('赵云')">Test 1</button> <button
阅读全文
摘要:1 代码结构 2 myc03.component.html <p>myc03 works!</p> <h3>name:{{name}}</h3> <h3>age:{{age}}</h3> <h3>老板:{{boss?.name}}-{{boss?.age}}-{{boss?.sex}}</h3> m
阅读全文
摘要:1 代码结构 2 myc02.component.html <p>myc02 works!</p> <h4>{{name}}</h4> <h4>{{age}}</h4> myc02.component.html 3 myc02.component.ts import { Component, OnI
阅读全文
摘要:1 代码结构 2 app.component.ts import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls
阅读全文
摘要:1 代码结构 2 myc02.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc02', 5 templateUrl: './myc02.com
阅读全文
摘要:1 代码结构 2 myc01.component.html 1 <p>myc01 works!</p> 2 3 <!--pipe管道--> 4 <!--与vue不同:vue中的管道需要用户自己定制声明--> 5 <!--angular官方提供了一些常用的管道--> 6 <ul> 7 <li>大写:{
阅读全文
摘要:1 代码结构 2 myc04.component.html 1 <p>myc04 works!</p> 2 3 <!--自定义指令--> 4 <div> 5 <input type="text"> 6 </div> 7 <div> 8 <!--自定义指令:ng generate directive
阅读全文
摘要:1 代码结构 2 myc03.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc03', 5 templateUrl: './myc03.com
阅读全文
摘要:1 代码结构 2 myc02.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc02', 5 templateUrl: './myc02.com
阅读全文
摘要:1 项目结构 2 myc01.component.ts 1 import { Component, OnInit } from '@angular/core'; 2 3 @Component({ 4 selector: 'app-myc01', 5 templateUrl: './myc01.com
阅读全文

浙公网安备 33010602011771号