This project was generated with Angular CLI version 8.3.20.
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
- A simple Number Counter Commponent to be used with Angular.
- It is developed using
Angular >=8.0.0and its newly introducedng g libraryschematics. - This library is part of JSBNumberCounter project and it is generated with Angular CLI version 8.3.21.
- Library location:
projects/jsbnum-counterdirectory of this repository.
- A simple Example can be found under
src/appdirectory of this repository.
npm i jsbnum-counter
import { JSBNumCounterModule } from 'jsbnum-counter'
selector: JSBNumCounter
| Input | Type | Required | Description |
|---|---|---|---|
| NumberData | string | YES | the Number Data to be disaplayed. |
- Register the
JSBNumCounterModulein your app module.
import { JSBNumCounterModule } from 'jsbnum-counter'
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatAutocompleteModule, MatInputModule } from '@angular/material';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { JSBNumCounterModule } from 'jsbnum-counter'
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
JSBNumCounterModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}- Use the selector
(JSBNumCounter)in your component.
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { AppService } from './app.service';
@Component({
selector: 'mat-ta-root',
template: `<JSBNumCounter [NumberData]='NumberData'></JSBNumCounter>
`,
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
///
}npm i- Run
ng servefor a dev server and running the demo app. Navigate tohttp://localhost:4200/. The app will automatically reload if you change any of the source files.
Run ng build JSBNumCounter to build the library. The build artifacts will be stored in the dist/jsbnum-counter directory. Use the --prod flag for a production build.
Run ng test JSBNumCounter to execute the unit tests via Karma.
This project is based on JSBNumCounter. Also want to thanks entire Angular team for creating this awesome framework.