摘要: import { Component,Input} from '@angular/core';@Component({ selector: 'app-lifecycle', templateUrl: './lifecycle.component.html', styleUrls: ['./lifec 阅读全文
posted @ 2019-12-05 20:45 fpc 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 父组件:news组件 子组件:header组件 阅读全文
posted @ 2019-12-05 20:39 fpc 阅读(400) 评论(0) 推荐(0) 编辑
摘要: /*ViewChild获取dom节点 1、模板中给dom起一个名字 <div #myBox> 我是一个dom节点 </div> 2、在业务逻辑里面引入ViewChild import { Component, OnInit,ViewChild} from '@angular/core'; 3、 写在 阅读全文
posted @ 2019-12-05 20:25 fpc 阅读(381) 评论(0) 推荐(0) 编辑
摘要: export class TodolistComponent implements OnInit { public keyword:string; public todolist:any[]=[]; constructor() { } ngOnInit() {} doAdd(e){ if(e.key 阅读全文
posted @ 2019-12-05 20:07 fpc 阅读(297) 评论(0) 推荐(0) 编辑