前沿web开发框架

Angular

Angular 是一个开发平台。它能帮你更轻松的构建 Web 应用。Angular 集声明式模板、依赖注入、端到端工具和一些最佳实践于一身,为你解决开发方面的各种挑战。Angular 为开发者提升构建 Web、手机或桌面应用的能力。

Angular 设置当前为focus指令

2020年05月26日

Angular设置当前为focus状态代码示例:import {Directive, ElementRef} from '@angular/core'; import {FocusableOption} from '@angular/cdk/a11y'; @Directive({ selector: '[appSurveyInput]' }) export class Surve...

Angular KeyboardEvent示例

2020年05月26日

这个示例监听键盘事件,具体代码如下:import {DOWN_ARROW, UP_ARROW} from '@angular/cdk/keycodes'; @HostListener('keydown', ['$event']) keydown($event: KeyboardEvent) { // 監聽鍵盤事件並依照案件設定按鈕focus狀態 if ($event...

mat-autocomplete select event事件处理

2020年05月26日

最近在使用Angular Material,mat-autocomplete select event事件具体写发:<mat-autocomplete #auto="matAutocomplete" (optionSelected)='getPhoneNumber($event.option.value)'> <mat-option *ngFor="let option of filteredO...

Observable.of is not a function

2020年05月26日

最近在写Angular日志记录功能的时候,出现了如下错误:Observable.of is not a function具体代码如下:export class LogConsole extends LogPublisher { log(record: LogEntry): Observable<() => boolean> { // Log to console cons...

Angular性能优化

2020年05月25日

1、Angular运行性能(Runtime Performance)优化指南2、Angular性能优化总结3、只是一篇关于vendor.bundle.js优化文件大小的方法,文章地址:vendor.bundle.js size is around 10 MB4、这篇文章详细的讲解了预加载与懒加载的相关问题:angular中的懒加载和预加载

Angular 的 Service Worker 简介

2020年05月25日

Angular Service Worker 简介:简单来说,Service Worker 就是一段运行在 Web 浏览器中,并为应用管理缓存的脚本。Service Worker 的功能就像一个网络代理。它们会拦截所有由应用发出的 HTTP 请求,并选择如何给出响应。 比如,它们可以查询局部缓存,如果有缓存的响应数据,就用它做出响应。 这种代理行为不会局限于通过程序调用 API(比如 fetch...

Angular HttpClient post

2020年05月25日

这篇文章很详细的介绍了使用HttpClient的Post提交方式,文章地址:Angular HttpClient post

TS2322: Type 'string' is not assignable to type 'never'.

2020年05月25日

最近在处理Angular错误消息的时候出现如下错误:TS2322: Type 'string' is not assignable to type 'never'.出现错误的代码:export class LinksComponent implements OnInit { sub: any; errorMessages: [] = []; constructor(priva...