node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »



Example of angular components library, based on angular-cli project.


It was generated by angular-cli with ng new ng-demo-lib --style scss -sd demo-app -p demo command and contains single commit to demonstrate the all changes you need to make a library.

This library has demo app, that could be used for documentation or sandbox purposes, and expose only lib directory. You could use ng serve -o true to run it.


[TL;DR] See ng-demo-app for usage example

  • create new angular-cli project: ng new ng-demo-app --style scss && cd ng-demo-app
  • install library: npm install --save git://
  • add module import declaration in app.module.ts:
   import { BrowserModule } from '@angular/platform-browser';
   import { NgModule } from '@angular/core';
   import { FormsModule } from '@angular/forms';
   import { HttpModule } from '@angular/http';
   import { MaterialModule } from '@angular/material';
   import { AppComponent } from './app.component';
   import { GreeterModule } from 'ng-demo-lib';
     declarations: [
     imports: [
     providers: [],
     bootstrap: [AppComponent]
  • use demo-greeter in app.component.html: <demo-greeter name="Peter Pan"></demo-greeter>
  • run project: ng serve -o true
  • profit