An angular directive to help input ipv4 address
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 {}
ngxIpv4Helper
should place on input with ngControl
Template form
<input ngModel ngxIpv4Helper />
Reactive form
<input [formControl]="ip" ngxIpv4Helper />
ip = new FormControl("");
Run ng build ngx-ipv4-helper --prod
to build the project. The build artifacts will be stored in the dist/
directory.
After building your library with ng build ngx-ipv4-helper
, go to the dist folder cd dist/ngx-ipv4-helper
and run npm publish
.