上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 25 下一页
摘要: 已安装完的请忽略 (此步骤参照 https://ng.ant.design/docs/getting-started/zh) 1、安装组件 $ npm install ng-zorro-antd --save 2. 导入模块 import { NzModalModule } from 'ng-zor 阅读全文
posted @ 2020-01-22 17:13 玄空2 阅读(917) 评论(0) 推荐(0) 编辑
摘要: for ..in 用来遍历迭代对象的键 即 如果 for. ..in 遍历的是数组,则输出的值 数组的下标 例子 this.str = new Array(); this.str.push('15'); this.str.push('20'); this.str.push('29'); for (c 阅读全文
posted @ 2020-01-22 16:27 玄空2 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 可选属性 带有可选属性的接口与普通的接口定义差不多,只是在可选属性名字定义的后面加一个?符号。 //可选类型的属性可以不用赋值 public my={label:"hello world"}; ngOnInit() { this.pritntLable(this.my); } pritntLable 阅读全文
posted @ 2020-01-11 22:11 玄空2 阅读(206) 评论(0) 推荐(0) 编辑
摘要: import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { MyObj } from 'src/app/pojo/myObj'; @Comp 阅读全文
posted @ 2020-01-11 21:39 玄空2 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 初始效果 点击添加行 点击添加数据 点击打印数据 点击清空数据 TS 部分代码讲解 /** * 获取数组对象 */ get arrayList() { return this.fg.get('arrayList') as FormArray; } 获取的 HTML页面的控件arrayList 对象 阅读全文
posted @ 2020-01-11 17:36 玄空2 阅读(852) 评论(0) 推荐(0) 编辑
摘要: 1. 在根模块下导入 import { ReactiveFormsModule } from '@angular/forms'; 2.ts 文件 import { Component, OnInit } from '@angular/core'; import { Router } from '@a 阅读全文
posted @ 2020-01-09 23:15 玄空2 阅读(882) 评论(0) 推荐(0) 编辑
摘要: 路由配置页 html页 get的路由跳转传值 <p>news works!</p> <ng-container *ngFor="let item of list;let key=index" > <a [routerLink]="['./work']" [queryParams]="{aid:key 阅读全文
posted @ 2020-01-07 21:29 玄空2 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.cnblogs.com/111testing/p/11474263.html 因为在我们加载对象的时候,用的是异步模式,即使promise(表示异步)立刻被处理返回,但是浏览器在开始加载对象的时候,这个对象还是没有定义,所以也就读不到属性。 data?.name 和 d 阅读全文
posted @ 2020-01-06 13:16 玄空2 阅读(3663) 评论(0) 推荐(0) 编辑
摘要: 注意事项: 单选按钮表单里 fromControlName 和name 的值必须相同 1.导入 import { ReactiveFormsModule } from '@angular/forms' 2.html模板 <form [formGroup]="fg"> <label>性别:</labe 阅读全文
posted @ 2020-01-02 22:33 玄空2 阅读(506) 评论(0) 推荐(0) 编辑
摘要: 1、在APPModule.ts文件配置 import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppRoutingModule } f 阅读全文
posted @ 2019-12-28 20:53 玄空2 阅读(253) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 25 下一页