我在 Ng-Idle、Material 6 和 Angular 6 中发现了一个问题
"@ng-idle/core": "^6.0.0-beta.3"
"@ng-idle/keepalive": "^6.0.0-beta.3"
"@angular/core": "^6.1.9"
"@angular/cdk": "^6.4.7"
"@angular/material": "^6.4.7"
Run Code Online (Sandbox Code Playgroud)
当用户空闲时,对话框(弹出窗口)会显示用户退出系统之前的倒计时。如果用户在用鼠标活动注销之前返回,倒计时将停止并且对话框将关闭/消失。
但是,在 Angular 5 中,此功能一直运行良好,直到我升级到 Angular 6。当用户在 之前返回时onTimeout,它会触发 ,onIdleEnd但对话框不会在鼠标活动时消失。我创建了一个 Angular 6 应用程序来复制这个问题。我试图确定这是 Ng-Idle 还是 Angular 问题。
Stackblitz 显示 Mat-Dialog 在 10 秒倒计时后关闭
有没有人遇到过这个问题?
我最近表演了一个
npm更新
命令并下拉Angular版本4.2.6.但是,当我跑
建立
我收到了一堆与@ angular/animations相关的构建错误.
见下文:
[alobban@linuxlaptop-advfrtsvr-advantagefreight-com afngine-ng2]$ ng build
Hash: eeeb38b2753a21366397
Time: 34119ms
chunk {0} main.bundle.js, main.bundle.js.map (main) 870 kB {4} [initial] [rendered]
chunk {1} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {5} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 714 kB {5} [initial] [rendered]
chunk {3} scripts.bundle.js, scripts.bundle.js.map (scripts) 471 kB {5} [initial] [rendered]
chunk {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.66 MB [initial] [rendered]
chunk {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
ERROR in /usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/animation_builder.d.ts (8,10): Module '"/usr/share/nginx/afngine-ng2/node_modules/@angular/animations/animations"' has …Run Code Online (Sandbox Code Playgroud) 我正在使用 Material 2.0.0-beta.12 运行 Angular 4.3.4,并且在尝试创建 mat-select 以从异步源生成动态 mat-option 列表时遇到问题。我得到的只是占位符,下拉列表不会扩展。我什至没有收到错误代码。
这是我的代码更新示例:
<form [formGroup]="snoozeForm" novalidate>
<div fxLayout="column">
<mat-form-field>
<mat-select formControlName="snooze_reason">
<mat-option [value]="reason.attributes.snooze_reason_code" *ngFor="let reason of reasons">{{ reason }}</mat-option>
</mat-select>
</mat-form-field>
</form>
Run Code Online (Sandbox Code Playgroud)
如您所见,原因是动态填充的数组。我一定忽略了一些简单的事情,但我确信原因越来越多。
这是我填充数组的地方:
ngOnInit() {
this.generateForm();
this.httpService.getSnoozeReasons()
.subscribe( res => {
this.reasons = res;
}, (error: any) => {
const msg: Message = { title: 'Frontend API Error', textbody1: '' };
if (error.message) {
msg.textbody1 = <any>error.message;
msg.textbody2 = `Task-details component - Snooze reasons`;
} …Run Code Online (Sandbox Code Playgroud)