1.0.12 • Published 6 years ago
jsbnum-counter v1.0.12
JSBNumberCounter
- 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.
Examples/Demo
- A simple Example can be found under
src/appdirectory of this repository.
Installation
npm i jsbnum-counter
Demo
API
import { JSBNumCounterModule } from 'jsbnum-counter'
selector: JSBNumCounter
@Inputs()
| Input | Type | Required | Description |
|---|---|---|---|
| NumberData | number | YES | the Number Data to be disaplayed. |
IE11
please use Pollyfill for IE support
Usage
1) Register the JSBNumCounterModule in 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 {} 2) 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'>My Counter</JSBNumCounter>
`,
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
///
}Running the example in local env
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.
Build the JSBNumCounter module
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.
Running unit tests
Run ng test JSBNumCounter to execute the unit tests via Karma.
Credits
This project is based on JSBNumCounter. Also want to thanks entire Angular team for creating this awesome framework.