【发布时间】:2020-01-24 17:55:44
【问题描述】:
它会向您发送在我的 Jhipster 4.8.2 应用程序中安装 spinnner ngx-loading 的步骤,它不会给出错误并且看起来没问题,但它不会绘制微调器:
安装:
npm install --save ngx-loading
在 app.module.ts 中:
import { LoadingModule } from 'ngx-loading';
....
imports: [
BrowserModule,
LayoutRoutingModule,
Ng2Webstorage.forRoot({ prefix: 'jhi', separator: '-' }),
Crm482SharedModule,
Crm482HomeModule,
Crm482HomeRRHHModule,
Crm482PrlModule,
Crm482MainModule,
Crm482AdminModule,
Crm482AccountModule,
Crm482EntityModule,
SimpleNotificationsModule.forRoot(),
LoadingModule
// jhipster-needle-angular-add-module JHipster will add new module here
],
main.component.html:
<simple-notifications [options]="optionsNotifications"></simple-notifications>
<ngx-loading [show]="loading" [config]="{ backdropBorderRadius: '14px' }"></ngx-loading>
<jhi-page-ribbon></jhi-page-ribbon>
<div>
<router-outlet name="navbar"></router-outlet>
</div>
<div class="container-fluid">
<!--I tried to put it here and it's not going-->
<div class="card jh-card">
<router-outlet></router-outlet>
<router-outlet name="popup"></router-outlet>
</div>
<jhi-footer></jhi-footer>
</div>
我的控制器:
export class MyControllerComponent implements OnInit, OnDestroy {
public loading = false;
......
ngOnInit() {
this.loading = true;
....
【问题讨论】:
-
是ngx-loading包,你的请求都使用HttpClientModule还是HttpModule? HttpClientModule 看不到使用 HttpModule 发出的请求,反之亦然。
-
当我把 this.loading = true;当我把它放到 this.loading = false; .根据例子。你确定它依赖于“HttpClientModule 还是 HttpModule”?