随笔分类 - 常用
摘要:1. postman的body请求格式为 raw (application/json), 则angular请求方式 const headers = new HttpHeaders().set("Content-Type", "application/json; charset=UTF-8").set
阅读全文
摘要:this.activatedRoute.params.subscribe(params => { console.log(params); console.log(+params['id']); });
阅读全文
摘要:因为在内存中指向的都是同一段内存地址,所以利用这个方法来解决: this.b = JSON.parse(JSON.stringify(this.a)); 参考地址:链接
阅读全文
摘要:删除数组指定key值 1. 数组是在页面定义,不是从api获取: const arrayData= [{index: 0,is_required: true,name: "vmvdnksl",type: "LONG_TEXT"},{index: 1,is_required: true,name: "
阅读全文
摘要:<input [(ngModel)]="field.name" [ngModelOptions]="{standalone: true}" class="form-control" type="text" name="{{field.name}}" /> 给input加上[ngModelOption
阅读全文
摘要:有时候会遇到这种情况,在a函数调用完之后再调用b函数接口,这时候就要用到angular http同步请求,下面是一种案例: //getDetails public async getLocationDetails(): Promise<any>{ let customBody = { "appID"
阅读全文
摘要:方法一 <input onkeypress="return /[a-z]/i.test(event.key)" > 方法二 <input type="text" name="field" maxlength="8" title="Only Letters" value="Type Letters O
阅读全文
摘要:git clone 远程指定的分支的代码 git clone -b feature/PD-102 https://EnvisionJahoon@bitbucket.org/lyceumhealth/cap.git
阅读全文
摘要:严格验证前端表单数据的提交,防止XSS跨站脚本攻击(Cross-Site Scripting)email验证手机号码input长度限制password 最好指定安全有效的格式,提高密码的验证要求特殊字段传输加密,本地存储的数据一律需要加密hidden inputs 也不例外防止多次重复请求日期/地址
阅读全文
摘要:链接: https://update.angular.io/ angular版本链接 https://github.com/angular/angular-cli/releases
阅读全文
摘要:1、按enter可以触发请求 2、有表单的页面,路由离开的时候,需要提示是否离开 3、点击特定的地方,需要将展示内容显示在页面可视区域 4、
阅读全文
摘要:// ts 文件代码 import { Subject } from 'rxjs'; import { debounceTime,map,takeUntil } from "rxjs/operators"; destroy$ = new Subject(); searchTbNameChange$
阅读全文
摘要:1、提交表单的时候,触发表单验证 a、触发整个表单验证:this.form.markAllAsTouched(); b、触发指定单个表单元素验证:this.form.controls.name.markAsTouched(); 2、angular11路由跳转: a页面跳入b页面,在b页面获取元素距离
阅读全文
摘要:this.userProfileForm.markAllAsTouched(); if (this.userProfileForm.controls.firstName.value == '') this.scrollToFirstInvalidControl('firstName'); else
阅读全文
摘要:<p style="-webkit-box-orient: vertical;">lsjo jsldl jldjfl lio; hi ni ll</p> p{ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webk
阅读全文
摘要: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);
阅读全文
摘要:.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);
阅读全文
摘要:input失去焦点的时候,如果数字有小数位则保留,否则自动添加.00 number.toFixed( [digits] ) this.value=Number(this.value).toFixed(2); 参考
阅读全文
摘要:::ng-deep .tooltip { background-color: red; color: blue; font-size: 20px; }
阅读全文

浙公网安备 33010602011771号