1
votes

I am trying to implement spinner for angular api calls using 'ng-http-loader'. The code works fine, however while building my app 'Yarn build' it fails with below error:

ERROR in Directive AbstractLoaderDirective in E:/~/node_modules/ng-http-loader/ng-http-loader.d.ts has no selector, please add it! Cannot determine the module for class AbstractLoaderDirective in E:/~/node_modules/ng-http-loader/ng-http-loader.d.ts! Add AbstractLoaderDirective to the NgModule to fix it.

Has anyone came across this error?

Implementation Following the steps provided in: 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>

Versions: Angular CLI: 8.3.1 Node: 13.11.0 OS: win32 x64 Angular: 8.2.4

Versions: "dependencies": { "@angular/common": "8.2.4", "@angular/compiler": "8.2.4", "@angular/core": "8.2.4", "@angular/forms": "8.2.4", "@angular/platform-browser": "8.2.4", "@angular/platform-browser-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",

1

1 Answers

0
votes

ng-http-loader version 7.0.0 has breaking changes, try installing "ng-http-loader": "^6.0.1" and the error should go away.