I created a class that extends from the @ionic/angular
node_module. However, AOT doesn’t like it one bit.
Does NOT compile:
import {
ChangeDetectorRef, ComponentRef, ElementRef, Injectable, NgModule, NgZone
} from '@angular/core';
import { IonProgressBar, IonToolbar } from '@ionic/angular';
import { DomService } from '../services/dom.service';
export class IonProgressBarExtended extends IonProgressBar {
constructor(
private c: ChangeDetectorRef,
private r: ElementRef<any>,
public z: NgZone,
private componentRef: ComponentRef<typeof IonProgressBar>,
private domService: DomService
) {
super(c, r, z);
}
// ...
}
Does compile, but obviously doesn’t work:
export class IonProgressBarExtended {
constructor(
private c: ChangeDetectorRef,
private r: ElementRef<any>,
public z: NgZone,
private componentRef: ComponentRef<typeof IonProgressBar>,
private domService: DomService
) {
// super(c, r, z);
}
// ...
}
The ProgressBarModule
is imported in the app.module.ts
and it works fine with ng serve and non-prod builds. However, once the AOT is called with the --prod
build flag, I get the following error:
Cannot determine the module for class IonProgressBarExtended in /Users/Reed/source/repos/IonicSideMenuPOC/src/app/shared/controllers/progress-bar-controller.ts! Add IonProgressBarExtended to the NgModule to fix it.
I have confirmed this on a completely new Ionic project, and have confirmed that it’s not a duplicate import issue. Has anybody else dealt with this?