A workaroud example of angular library, until angular/angular-cli#1692 will be solved
Example of angular components library workaround, based on @angular/cli project.
aot
buildng new ng-demo-lib --style scss -sd lib -p demo
ng serve -o true
to run it.lib
directory.[TL;DR] See @ns/ng-demo-app and live demo.
ng new ng-demo-app --style scss
npm install --save git://[email protected]:nsmolenskii/ng-demo-lib.git
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';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
MaterialModule.forRoot(),
GreeterModule
],
providers: [],
bootstrap: [AppComponent]
})
demo-greeter
in app.component.html
: <demo-greeter name="Peter Pan"></demo-greeter>
ng serve -o true