1.0.1 • Published 6 years ago

@retailify/ngx-mat-numberpicker v1.0.1

Weekly downloads
30
License
MIT
Repository
github
Last release
6 years ago

ngx-mat-numberpicker

Angular numberpicker component based on Angular Material.

alt example image

Installation

To install this library (component), run:

Using npm:

$ npm install @retailify/ngx-mat-numberpicker --save

Using yarn:

$ yarn add @retailify/ngx-mat-numberpicker

Consuming this library (component)

You can import this library (component) in any Angular application by running:

Using npm:

$ npm install @retailify/ngx-mat-numberpicker

Using yarn:

$ yarn add @retailify/ngx-mat-numberpicker

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import this library
import { NumberPickerModule } from '@retailify/ngx-mat-numberpicker';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    
    // Specify this library as an import
    NumberPickerModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once this library is imported, you can use its components, directives and pipes in your Angular application:

<!-- You can now use this library component in app.component.html -->
<h1>
  {{title}}
</h1>
<ngx-mat-numberpicker [min]="1" [max]="6" [default]="1" [starttext]="'Hello World'" [endtext]="'Hello World'" [disabled]="true" (onChange)="onValueChanged($event)"></ngx-mat-numberpicker>
class YourClass {
    currentValue: number = 1;
    
    onValueChanged(value: number): void {
        this.currentValue = value;
    }
}

Component Inputs and Outputs

AttributeTypeRequiredDescription
mininput NumberNoThe minimal number limit on the number picker. 0 by default
maxinput NumberNoThe maximum number limit on the number picker. 50 by default
defaultinput NumberNoThe default value for the number picker. 0 by default
starttextinput StringNoThe value for the hint starttext of the inputfield. Empty by default
endtextinput StringNoThe value for the hint endtext of the inputfield. Empty by default
disabledinput BooleanNoDefines if the input input field should be disabled / enabled by the user. false by default
onChange(output) NumberNoThe onChange event of the component. Emits the value of the number picker, every time the user has clicked the - or + button.

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

To lint all *.ts files:

$ npm run lint

To run demo:

$ npm run playground

License

MIT © Retailify GmbH

1.0.1

6 years ago

1.0.0

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago