Angular动态组件
摘要:一、主页面: app.component.html: 1 <button (click)="load();">动态</button> 2 2<div #domRoom><!--动态组件加载到这个div里--></div> app.component.ts: 1 import {Component,
阅读全文
posted @
2018-09-11 16:47
陌生街中吹起褪色故梦
阅读(165)
推荐(0) 编辑
Angular惰性加载的特性模块
摘要:一:Angular-CLI建立应用 cmd命令:ng new lazy-app --routing (创建一个名叫 lazy-app 的应用,而 --routing 标识生成了一个名叫 app-routing.module.ts 的文件) cd lazy-app (进入lazy-app项目) 二:创
阅读全文
posted @
2018-09-11 11:58
陌生街中吹起褪色故梦
阅读(830)
推荐(0) 编辑
angular2事件触发
摘要:输入框输入过程触发Select()方法。 <input type="text" name="code" [(ngModel)]="code" (keyup)="Select()"> 输入框输入完触发Select()方法。 <input type="text" name="code" [(ngMode
阅读全文
posted @
2017-10-20 20:21
陌生街中吹起褪色故梦
阅读(407)
推荐(0) 编辑
Angular2日期格式化
摘要:一:组件日期格式化: ts中调用: import {DatePipe} from "@angular/common"; @Component({ providers: [DatePipe], }) export class CustomerManageComponent { constructor(
阅读全文
posted @
2017-10-15 21:56
陌生街中吹起褪色故梦
阅读(3629)
推荐(0) 编辑
angular2-cli 安装
摘要:1.如果你之前安装失败过,最好在安装angular-cli之前先卸载干净,用以下两句: npm uninstall -g angular-cli npm cache clean npm uninstall -g angular-cli npm cache clean 2.设置淘宝镜像,国内访问国外网
阅读全文
posted @
2017-10-15 19:49
陌生街中吹起褪色故梦
阅读(645)
推荐(0) 编辑