指令AbstractLoader中的错误〜/ node_modules / ng-http-loader / ng-http-loader.d.ts中没有选择器,请添加它

问题描述 投票:0回答:1

我正在尝试使用'ng-http-loader'实现角度API调用的微调器。该代码工作正常,但是在构建我的应用程序“ Yarn build”时失败,并显示以下错误:

指令AbstractLoader中的错误E:/~/node_modules/ng-http-loader/ng-http-loader.d.ts中的指令没有选择器,请添加它!无法在E:/~/node_modules/ng-http-loader/ng-http-loader.d.ts中确定类AbstractLoaderDirective的模块!将AbstractLoaderDirective添加到NgModule以对其进行修复。

有人遇到此错误吗?

实施请按照https://www.npmjs.com/package/ng-http-loader中提供的步骤进行>

production.module.ts:

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule } from '@angular/router';

import { OnesortParcelsSharedModule } from 'app/shared/shared.module';
import { NgHttpLoaderModule } from 'ng-http-loader';

import { PRODUCTION_ROUTE, ProductionComponent } from './';


@NgModule({
  imports: [OnesortParcelsSharedModule, NgHttpLoaderModule.forRoot(), RouterModule.forRoot([PRODUCTION_ROUTE], { useHash: true })],
  declarations: [ProductionComponent],
  entryComponents: [],
  providers: [],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})

export class OnesortParcelsAppProductionModule {}
production.component.html:

<ng-http-loader [filteredMethods]="['GET', 'POST']"></ng-http-loader>

版本:Angular CLI:8.3.1节点:13.11.0操作系统:win32 x64角度:8.2.4

版本:“依赖关系”:{“ @ angular / common”:“ 8.2.4”,“ @ angular / compiler”:“ 8.2.4”,“ @ angular / core”:“ 8.2.4”,“ @ angular / forms”:“ 8.2.4”,“ @ angular / platform-b​​rowser”:“ 8.2.4”,“ @ angular / platform-b​​rowser-dynamic”:“ 8.2.4”,“ @ angular / router”:“ 8.2.4”,“ @ fortawesome / angular-fontawesome”:“ 0.5.0”,“ @ fortawesome / fontawesome-svg-core”:“ 1.2.22”,“ @ fortawesome / free-solid-svg-icons”:“ 5.10.2”,“ @ ng-bootstrap / ng-bootstrap”:“ ^ 5.2.1”,“ @ ngx-translate / core”:“ 11.0.1”,“ @ ngx-translate / http-loader”:“ 4.0.0”,“ bootstrap”:“ 4.3.1”,“ core-js”:“ 3.2.1”,“ moment”:“ 2.24.0”,“ ng-http-loader”:“ ^ 7.0.0”,

我正在尝试使用'ng-http-loader'实现角度API调用的微调器。代码工作正常,但是在构建我的应用程序“ Yarn build”时失败,并出现以下错误:指令中出现ERROR ...

angular api spinner angular2-directives
1个回答
0
投票

ng-http-loader版本7.0.0进行了重大更改,请尝试安装"ng-http-loader": "^6.0.1",错误应消失。

© www.soinside.com 2019 - 2024. All rights reserved.