Socket
Book a DemoInstallSign in
Socket

ngx-validate-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-validate-tooltip

a validate tooltip built with Angular4 inspired by [PrimeNG](https://github.com/primefaces/primeng/blob/master/components/tooltip/tooltip.ts)

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

NgValidateTooltip

a validate tooltip built with Angular4 inspired by PrimeNG

Installation

npm i ngx-validate-tooltip --save

Usage

Import In AppModule

....
+ import {ValidateMsgService, ValidateTooltipModule} from 'ngx-validate-tooltip';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
+    ValidateTooltipModule,
  ],
  providers: [
+    ValidateMsgService
    // { provide: ValidateMsgService, useClass: CustomValidateMsgService }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Use In Templete

// app.component.html
<form [formGroup]="ngForm" >
  <app-validate-tooltip [control]="ngForm.get('start')">
    <input pInputText formControlName="start">
  </app-validate-tooltip>

  <app-validate-tooltip [control]="ngForm.get('end')">
    <input pInputText formControlName="end">
  </app-validate-tooltip>

  <app-validate-tooltip [control]="ngForm.get('city')">
    <input pInputText formControlName="city">
  </app-validate-tooltip>
</form>

// app.component.ts
export class AppComponent implements OnInit{

  ngForm: FormGroup;

  constructor(private fb: FormBuilder) {

  }

  ngOnInit() {
    this.ngForm = this.fb.group({
      start: ['', [Validators.required, Validators.minLength(4)]],
      end: ['', [Validators.required, Validators.minLength(4)]],
      city: ['', []],
      address: ['', [Validators.required, Validators.minLength(4)]],
    });
  }
}

Custom Your Own ValidateMsg

like this And You should import in AppModule.

  providers: [
    //ValidateMsgService
+     { provide: ValidateMsgService, useClass: CustomValidateMsgService }
  ],

Keywords

angular

FAQs

Package last updated on 05 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts