Reputation: 444
Is it possible to create a typescript file of all component references to use in different modules like the app module and app-routing module to avoid duplication?
import { AppComponent } from './app.component';
import { HeaderComponent } from './components/header.component';
import { BreadcrumbComponent } from'./components/breadcrumb.component';
Up want to just be able to do something like this
import from '/components'
Upvotes: 1
Views: 123
Reputation: 1953
You should create file .components/index.ts
index.ts
export * from './components/header.component'
export * from './components/breadcrumb.component'
Now you can use as:
import {HeaderComponent,BreadcrumbComponent } from './components'
Upvotes: 1