mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Merge pull request #280 from Alfresco/dev-wabson-195
Prevent error message when not enough alphanum characters in term
This commit is contained in:
@@ -19,6 +19,7 @@ import { Control, Validators } from '@angular/common';
|
||||
import { Component, Input, Output, ElementRef, EventEmitter, AfterViewInit, ViewChild } from '@angular/core';
|
||||
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { AlfrescoSearchAutocompleteComponent } from './alfresco-search-autocomplete.component';
|
||||
import { SearchTermValidator } from './../forms/search-term-validator';
|
||||
|
||||
declare let __moduleName: string;
|
||||
declare var componentHandler: any;
|
||||
@@ -71,7 +72,7 @@ export class AlfrescoSearchControlComponent implements AfterViewInit {
|
||||
|
||||
this.searchControl = new Control(
|
||||
this.searchTerm,
|
||||
Validators.compose([Validators.required, Validators.minLength(3)])
|
||||
Validators.compose([Validators.required, SearchTermValidator.minAlphanumericChars(3)])
|
||||
);
|
||||
|
||||
this.searchControl.valueChanges.map(value => this.searchControl.valid ? value : '')
|
||||
|
Reference in New Issue
Block a user