How to export Class(not Component) from Angular Library(package)

Viewed 1168

Ive tried several answer here but none worked for me. Im trying to export Class from library and use it on my other app. but when I try doing it I get this error:

ROR TypeError: marvilix_header__WEBPACK_IMPORTED_MODULE_1__.RoutingHeader is not a constructor

my code: routing-class.ts

export class RoutingHeader{

    public itsActive: boolean;
    public Name: string;
    public Button: boolean;
    public Route: string;
    public links: Array<RoutingHeader>;

    constructor(name:string,button:boolean,route:string,links:Array<RoutingHeader>){
        this.Name = name;
        this.Button = button;
        this.Route = route;
        this.links = links;
        this.itsActive = false;
    }

}

public_api.ts

export * from './lib/marvilix-header.service';
export * from './lib/marvilix-header.component';
export * from './lib/marvilix-header.module';
export * from './lib/routing-class';

app.component.ts

import { Component } from '@angular/core';
import { RoutingHeader } from 'marvilix-header';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  public links:Array<RoutingHeader>;
  constructor(){
   this.links = [
     new RoutingHeader("s",false,"s",null)
   ] 
  }
}

any thoughts? Tnx in advance!

0 Answers
Related