随笔分类 -  常用

摘要:1. postman的body请求格式为 raw (application/json), 则angular请求方式 const headers = new HttpHeaders().set("Content-Type", "application/json; charset=UTF-8").set 阅读全文
posted @ 2021-12-15 14:51 jahoon 阅读(237) 评论(0) 推荐(0)
摘要:this.activatedRoute.params.subscribe(params => { console.log(params); console.log(+params['id']); }); 阅读全文
posted @ 2021-12-14 19:42 jahoon 阅读(95) 评论(0) 推荐(0)
摘要:因为在内存中指向的都是同一段内存地址,所以利用这个方法来解决: this.b = JSON.parse(JSON.stringify(this.a)); 参考地址:链接 阅读全文
posted @ 2021-11-04 17:02 jahoon 阅读(35) 评论(0) 推荐(0)
摘要:删除数组指定key值 1. 数组是在页面定义,不是从api获取: const arrayData= [{index: 0,is_required: true,name: "vmvdnksl",type: "LONG_TEXT"},{index: 1,is_required: true,name: " 阅读全文
posted @ 2021-11-04 09:26 jahoon 阅读(80) 评论(0) 推荐(0)
摘要:<input [(ngModel)]="field.name" [ngModelOptions]="{standalone: true}" class="form-control" type="text" name="{{field.name}}" /> 给input加上[ngModelOption 阅读全文
posted @ 2021-10-25 10:19 jahoon 阅读(132) 评论(0) 推荐(0)
摘要:有时候会遇到这种情况,在a函数调用完之后再调用b函数接口,这时候就要用到angular http同步请求,下面是一种案例: //getDetails public async getLocationDetails(): Promise<any>{ let customBody = { "appID" 阅读全文
posted @ 2021-10-11 14:22 jahoon 阅读(387) 评论(0) 推荐(0)
摘要:方法一 <input onkeypress="return /[a-z]/i.test(event.key)" > 方法二 <input type="text" name="field" maxlength="8" title="Only Letters" value="Type Letters O 阅读全文
posted @ 2021-09-17 22:33 jahoon 阅读(543) 评论(0) 推荐(0)
摘要:1、利用函数传参的方式过滤数据 2、 阅读全文
posted @ 2021-09-13 11:12 jahoon 阅读(80) 评论(0) 推荐(0)
摘要:git clone 远程指定的分支的代码 git clone -b feature/PD-102 https://EnvisionJahoon@bitbucket.org/lyceumhealth/cap.git 阅读全文
posted @ 2021-08-30 18:05 jahoon 阅读(27) 评论(0) 推荐(0)
摘要:严格验证前端表单数据的提交,防止XSS跨站脚本攻击(Cross-Site Scripting)email验证手机号码input长度限制password 最好指定安全有效的格式,提高密码的验证要求特殊字段传输加密,本地存储的数据一律需要加密hidden inputs 也不例外防止多次重复请求日期/地址 阅读全文
posted @ 2021-06-21 21:22 jahoon 阅读(82) 评论(0) 推荐(0)
摘要:链接: https://update.angular.io/ angular版本链接 https://github.com/angular/angular-cli/releases 阅读全文
posted @ 2021-05-24 15:55 jahoon 阅读(215) 评论(0) 推荐(0)
摘要:1、按enter可以触发请求 2、有表单的页面,路由离开的时候,需要提示是否离开 3、点击特定的地方,需要将展示内容显示在页面可视区域 4、 阅读全文
posted @ 2021-04-23 09:57 jahoon 阅读(78) 评论(0) 推荐(0)
摘要:// ts 文件代码 import { Subject } from 'rxjs'; import { debounceTime,map,takeUntil } from "rxjs/operators"; destroy$ = new Subject(); searchTbNameChange$ 阅读全文
posted @ 2021-04-01 21:01 jahoon 阅读(203) 评论(0) 推荐(0)
摘要:1、提交表单的时候,触发表单验证 a、触发整个表单验证:this.form.markAllAsTouched(); b、触发指定单个表单元素验证:this.form.controls.name.markAsTouched(); 2、angular11路由跳转: a页面跳入b页面,在b页面获取元素距离 阅读全文
posted @ 2021-03-26 17:18 jahoon 阅读(227) 评论(0) 推荐(0)
摘要:this.userProfileForm.markAllAsTouched(); if (this.userProfileForm.controls.firstName.value == '') this.scrollToFirstInvalidControl('firstName'); else 阅读全文
posted @ 2021-03-16 14:33 jahoon 阅读(199) 评论(0) 推荐(0)
摘要:<p style="-webkit-box-orient: vertical;">lsjo jsldl jldjfl lio; hi ni ll</p> p{ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webk 阅读全文
posted @ 2021-02-05 14:44 jahoon 阅读(74) 评论(0) 推荐(0)
摘要:box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); 阅读全文
posted @ 2021-02-05 14:17 jahoon 阅读(67) 评论(0) 推荐(0)
摘要:.image-link img:hover{ position: relative; -webkit-transform: scale(1.5); -ms-transform: scale(1.5); -o-transform: scale(1.5); transform: scale(1.5); 阅读全文
posted @ 2021-02-04 14:40 jahoon 阅读(130) 评论(0) 推荐(0)
摘要:input失去焦点的时候,如果数字有小数位则保留,否则自动添加.00 number.toFixed( [digits] ) this.value=Number(this.value).toFixed(2); 参考 阅读全文
posted @ 2020-12-28 14:00 jahoon 阅读(115) 评论(0) 推荐(0)
摘要:::ng-deep .tooltip { background-color: red; color: blue; font-size: 20px; } 阅读全文
posted @ 2020-12-24 20:54 jahoon 阅读(146) 评论(0) 推荐(0)