摘要:
模板在组件类中的引用(单个) 使用引用名 2. 使用组件类型 引用多个模板元素 @ViewChild 总结 @ViewChild 用来在类中引用模板中的视图节点 可以是 Angular 组件,也可以是HTML元素 在AfterViewInit 中可以安全的使用 @ViewChild 引用的元素 推荐 阅读全文
摘要:
FunGetDateStr: function (p_count) { var dd = new Date(); dd.setDate(dd.getDate() + p_count);//获取p_count天后的日期 var y = dd.getFullYear(); var m = dd.getM 阅读全文
摘要:
import { Component, OnInit, Input, Output, EventEmitter, SimpleChanges, OnChanges, AfterContentInit, AfterContentChecked, AfterViewChecked, AfterViewI 阅读全文
摘要:
class.className 直观,适合单一class的显示和隐藏 ngClass 非常灵活 , 可以同时操作几个类的改变 true为显示,false为失效 ngStyle 适合特殊需求,不需要class 子组件HTML<ul [ngStyle]="{'background-color':back 阅读全文
摘要:
ngIf 指令 <span *ngIf="i selectedIndex" class="botStyle"></span> 组件的输入输出 子组件: import { Component, OnInit, Input, Output, EventEmitter } from '@angular/c 阅读全文
摘要:
npm install -g @angular/cli //安装angular脚手架 ng version 出现版本信息即安装成功。 ng new 项目名称 在终端中,进入想要创建项目的地址执行 ng serve 启动项目 ng g c components/nav 在定义的components路径 阅读全文
摘要:
<a href="#" [class.active]="i selectedIndex" (click)="selectedIndex i"> {{ menu.title }}</a> [class.样式名]="判断表达式" 是在应用单个class时的常用技巧 使用 方括号[ ]是数据绑定,如果带方 阅读全文
摘要:
cmd 找到nodejs的安装路径(where node命令助你找到node原安装路径) 官网下载新版本 安装时覆盖老版本路径即可 阅读全文