1.0.0 • Published 4 years ago

ngx-ipv4-helper v1.0.0

Weekly downloads
8
License
-
Repository
github
Last release
4 years ago

ngx-ipv4-helper

An angular directive to help input ipv4 address

Demo application

Installation

To install this library, run:

$ npm install ngx-ipv4-helper --save

and then import module:

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

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

import { NgxIpv4HelperModule } from "ngx-ipv4-helper"; // <===

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    NgxIpv4HelperModule, // <===
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

Usage

ngxIpv4Helper should place on input with ngControl

Template form

<input ngModel ngxIpv4Helper />

Reactive form

<input [formControl]="ip" ngxIpv4Helper />
ip = new FormControl("");