Starter for creating Angular NPM packages.
npm install ngx-hello-npm --save
import { HelloModule } from 'ngx-hello-npm';
...
@NgModule({
...
declarations: [
AppComponent,
...
],
imports: [
BrowserModule,
FormsModule,
HelloModule,
...
...
})
export class AppModule {}
@Component({
selector: 'my-app',
template: `
<h3>Hello NPM</h3>
<div>
<hello></hello>
</div>
`,
})
export class App {
...
}
The index.js
file exports the HelloModule from the ./src/app/hello
directory. TypeScript definition files are in the index.d.ts
file. If changing the directory of the exported module, or adding exported modules, please update these two index files and make the necessary changes to tsconfig-aot.json
's "include" array. You may also want to update the npm clean script.
git clone https://github.com/johnfedoruk/ngx-hello-npm
cd ngx-hello-npm
npm install
-
ng serve
# Navigate tohttp://localhost:4200/
. The app will automatically reload if you change any of the source files.
- Same as above, except for the last step do:
-
npm run test-once
# Executes the unit tests via Karma.
- Same as above, except for the last step do:
-
ng e2e
# Executes the end-to-end tests via Protractor.