上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 模板在组件类中的引用(单个) 使用引用名 2. 使用组件类型 引用多个模板元素 @ViewChild 总结 @ViewChild 用来在类中引用模板中的视图节点 可以是 Angular 组件,也可以是HTML元素 在AfterViewInit 中可以安全的使用 @ViewChild 引用的元素 推荐 阅读全文
posted @ 2019-12-07 11:18 砂糖一椰子 阅读(593) 评论(0) 推荐(0) 编辑
摘要: FunGetDateStr: function (p_count) { var dd = new Date(); dd.setDate(dd.getDate() + p_count);//获取p_count天后的日期 var y = dd.getFullYear(); var m = dd.getM 阅读全文
posted @ 2019-12-06 17:45 砂糖一椰子 阅读(6707) 评论(1) 推荐(0) 编辑
摘要: import { Component, OnInit, Input, Output, EventEmitter, SimpleChanges, OnChanges, AfterContentInit, AfterContentChecked, AfterViewChecked, AfterViewI 阅读全文
posted @ 2019-12-05 20:13 砂糖一椰子 阅读(635) 评论(0) 推荐(0) 编辑
摘要: class.className 直观,适合单一class的显示和隐藏 ngClass 非常灵活 , 可以同时操作几个类的改变 true为显示,false为失效 ngStyle 适合特殊需求,不需要class 子组件HTML<ul [ngStyle]="{'background-color':back 阅读全文
posted @ 2019-12-05 16:32 砂糖一椰子 阅读(588) 评论(0) 推荐(0) 编辑
摘要: ngIf 指令 <span *ngIf="i selectedIndex" class="botStyle"></span> 组件的输入输出 子组件: import { Component, OnInit, Input, Output, EventEmitter } from '@angular/c 阅读全文
posted @ 2019-12-05 14:56 砂糖一椰子 阅读(661) 评论(0) 推荐(0) 编辑
摘要: npm install -g @angular/cli //安装angular脚手架 ng version 出现版本信息即安装成功。 ng new 项目名称 在终端中,进入想要创建项目的地址执行 ng serve 启动项目 ng g c components/nav 在定义的components路径 阅读全文
posted @ 2019-12-04 20:30 砂糖一椰子 阅读(474) 评论(0) 推荐(0) 编辑
摘要: <a href="#" [class.active]="i selectedIndex" (click)="selectedIndex i"> {{ menu.title }}</a> [class.样式名]="判断表达式" 是在应用单个class时的常用技巧 使用 方括号[ ]是数据绑定,如果带方 阅读全文
posted @ 2019-12-03 09:59 砂糖一椰子 阅读(492) 评论(0) 推荐(0) 编辑
摘要: cmd 找到nodejs的安装路径(where node命令助你找到node原安装路径) 官网下载新版本 安装时覆盖老版本路径即可 阅读全文
posted @ 2019-12-02 23:09 砂糖一椰子 阅读(2116) 评论(0) 推荐(0) 编辑
摘要: 1变量应用范围 包含ngFor的元素及内部元素 2 索引的获取 let i = index; 3第一个元素和最后一个元素 let first = first; let last = last; 4 奇和偶 let odd = odd;let even = even 5提升性能 trackBy:tra 阅读全文
posted @ 2019-11-29 18:31 砂糖一椰子 阅读(3213) 评论(0) 推荐(0) 编辑
摘要: 1,ul>li*3>a[href="#"] <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> 阅读全文
posted @ 2019-11-29 17:25 砂糖一椰子 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页