In this lesson will see how can we use the Configurable Angular Library Module in any angular application which we have made.
As we import other modules similarly we will import our library into our app.module.ts
app.module.ts
... import { NewsTwentyfourModule } from 'projects/news-twentyfour/src/public-api'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, NewsTwentyfourModule.forRoot({Token: 'xxxx-xxxx-xxxxxxxx-xxxxxxxxxxxxxx'}) ], bootstrap: [AppComponent] }) export class AppModule { }
And then directly in our app.component.html, we can add the library component so it will view the news details from the library to our angular application.
app.component.html
<h1>News List</h1> <lib-news-twentyfour></lib-news-twentyfour>