I am facing a challenge with packaging a TypeScript class as part of an Angular module for exporting it as a library using ng-packagr
.
For instance, here is my class definition -
export class Params {
language: string ;
country: string ;
variant: string ;
dateFormat: string ;
briefDateTimeFormat: string ;
decimalFormat: string ;
}
This is how I have defined my module -
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Params } from '../params/params';
import { LoginService } from '../sso/login.service';
@NgModule({
imports: [CommonModule],
exports: [Params],
providers: [LoginService]
declarations: [Params, LoginService]
})
export class FoundationModule { }
However, when trying to export the FoundationModule
in public-api.ts
of ng-packagr
, I encounter the following error -
BUILD ERROR
: Unexpected value 'Params in .../params/params.ts' declared by the module 'FoundationModule' in '.../foundation.module.ts'. Please add a @Pipe/@Directive/@Component annotation.
I am seeking guidance on how to successfully package a single class within an Angular module.