“2020年5月”存档文章有39

mat-autocomplete select event事件处理

最近在使用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

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

Angular性能优化

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

Angular 的 Service Worker 简介

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

Angular HttpClient post

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

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

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

“rxjs” observable.throw is not a function

最近在处理Angular Observable错误的的时候,出现了如下错误:“rxjs” observable.throw is not a function出现问题的原因:由于版本变更,原来的写法已经不再使用。具体代码如下:private static handleErrors(error: any): Observable { const errors: string[] = [];...

Could not subscribe to notifications Error: Service workers are disabled or not supported by this browser

最近在Angular中需要使用notification推送服务,按照这篇文章操作:Angular Push Notifications: a Complete Step-by-Step Guide,在点击订阅的时候出现了如下错误:Could not subscribe to notifications Error: Service workers are disabled or not suppo...