An angular directive to help input ipv4 address
npm install ngx-ipv4-helperAn angular directive to help input ipv4 address
To install this library, run:
``bash`
$ npm install ngx-ipv4-helper --save
and then import module:
`typescript
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 {}
`
ngxIpv4Helper should place on input with ngControl
Template form
`html`
Reactive form
`html`
`ts``
ip = new FormControl("");