This project is an implementation of Angular Package Format v4.0, so as to build library of components for angular applications. As a consequence, the library can be consumed in various ways, e.g. from apps using Webpack, from apps using SystemJS, from a jsfiddle, a plunkr, etc.
- Generation to various module formats: FESM15, FESM5, UMD
- Type definitions
- Metadata for AOT compilation
- Clone the library
git clone https://github.com/michaelbazos/angular-library-starter.git
- Install dependencies and build the library
cd angular-library-starter
npm install
npm run build
- Add the built library as dependency to your application
From your consumer application folder:
npm install ../angular-library-starter/dist --save
Adjust the path to the dist folder accordingly.
Note 1: this installation refers to a local folder. Once you're done you should publish your library to a package manager.
Note 2: Argument --save
is implicit as of npm5
- Import the library in the application
import { MylibModule } from 'mylib';
@NgModule({
declarations: [
AppComponent
],
imports: [
... ,
MylibModule
],
providers: [],
bootstrap: [ AppComponent ]
})
export class AppModule { }
- Use the components
<ui-dropdown></ui-dropdown>
MIT © Michael Bazos