2019年5月21日

Angular 中的生命周期函数

摘要: 一、 Angular中的生命周期函数 官方文档:https://www.angular.cn/guide/lifecycle-hooks 生命周期函数通俗的讲就是组件创建、组件更新、组件销毁的时候会触发的一系列的方法。 当 Angular 使用构造函数新建一个组件或指令后,就会按下面的顺序在特定时刻 阅读全文

posted @ 2019-05-21 17:22 LoaderMan 阅读(2038) 评论(0) 推荐(1) 编辑

angular父组件通过@ViewChild 主动获取子组 件的数据和方法

摘要: 1.调用子组件给子组件定义一个名称 <app-footer #footerChild></app-footer> 2. 引入 ViewChild import { Component, OnInit ,ViewChild} from '@angular/core'; 3. ViewChild 和刚才 阅读全文

posted @ 2019-05-21 16:12 LoaderMan 阅读(1438) 评论(0) 推荐(0) 编辑

angular中子组件通过@Output 触发父组件的方 法

摘要: 1. 子组件引入 Output 和 EventEmitter import { Component, OnInit ,Input,Output,EventEmitter} from '@angular/core'; 2.子组件中实例化 EventEmitter @Output() private o 阅读全文

posted @ 2019-05-21 16:04 LoaderMan 阅读(3155) 评论(0) 推荐(0) 编辑

angular中父组件给子组件传值-@input

摘要: 1. 父组件调用子组件的时候传入数据 <app-header [msg]="msg"></app-header> 2. 子组件引入 Input 模块 import { Component, OnInit ,Input } from '@angular/core'; 3. 子组件中 @Input 接收 阅读全文

posted @ 2019-05-21 14:27 LoaderMan 阅读(2283) 评论(0) 推荐(0) 编辑

Angular 执行 css3 简单的动画

摘要: 效果: 阅读全文

posted @ 2019-05-21 10:56 LoaderMan 阅读(471) 评论(0) 推荐(0) 编辑

Angular 中的 dom 操作(ViewChild)以及父子组件中通过 ViewChild 调用子组件的方法

摘要: 效果: 阅读全文

posted @ 2019-05-21 10:35 LoaderMan 阅读(1746) 评论(0) 推荐(0) 编辑

angular 中的dom操作(原生JS)

摘要: 效果: 阅读全文

posted @ 2019-05-21 10:29 LoaderMan 阅读(457) 评论(0) 推荐(0) 编辑

导航