Skip to content

Instantly share code, notes, and snippets.

@timjonesdev
Last active June 27, 2019 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timjonesdev/650fc1a87c569b52f18f4eb715c9f3cc to your computer and use it in GitHub Desktop.
Save timjonesdev/650fc1a87c569b52f18f4eb715c9f3cc to your computer and use it in GitHub Desktop.
The correct way to import modules in an Angular library
import {NgModule} from '@angular/core';
import {MyLibComponent} from './my-lib.component';
import {NavigationModule} from "./navigation/navigation.module"; // <-- lengthened
import {FormModule} from "./form/form.module"; // <-- lengthened
@NgModule({
declarations: [MyLibComponent],
imports: [NavigationModule, FormModule],
exports: [NavigationModule, FormModule]
})
export class MyLibModule {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment