remove componentHandler.upgradeAllRegistered

This commit is contained in:
Eugenio Romano
2016-08-31 11:07:49 +01:00
parent e8b274afbb
commit 7e0746f563
2 changed files with 9 additions and 18 deletions

View File

@@ -1,10 +1,10 @@
<form (submit)="onSearch($event)">
<div [class]="getTextFieldClassName()">
<label *ngIf="expandable" class="mdl-button mdl-js-button mdl-button--icon" for="searchControl">
<i class="material-icons">search</i>
<i mdl-upgrade class="material-icons">search</i>
</label>
<div [class]="getTextFieldHolderClassName()">
<input class="mdl-textfield__input" [type]="inputType" [autocomplete]="getAutoComplete()" data-automation-id="search_input"
<input mdl-upgrade class="mdl-textfield__input" [type]="inputType" [autocomplete]="getAutoComplete()" data-automation-id="search_input"
#searchInput id="searchControl" [ngFormControl]="searchControl" [(ngModel)]="searchTerm" (focus)="onFocus($event)"
(blur)="onBlur($event)" aria-labelledby="searchLabel">
<label id="searchLabel" class="mdl-textfield__label" for="searchControl">{{'SEARCH.CONTROL.LABEL' | translate}}</label>

View File

@@ -16,25 +16,22 @@
*/
import { Control, Validators } from '@angular/common';
import { Component, Input, Output, ElementRef, EventEmitter, AfterViewInit, ViewChild } from '@angular/core';
import { Component, Input, Output, ElementRef, EventEmitter, 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;
@Component({
moduleId: __moduleName,
selector: 'alfresco-search-control',
styles: [
],
templateUrl: './alfresco-search-control.component.html',
styleUrls: ['./alfresco-search-control.component.css'],
directives: [AlfrescoSearchAutocompleteComponent],
pipes: [AlfrescoPipeTranslate]
})
export class AlfrescoSearchControlComponent implements AfterViewInit {
export class AlfrescoSearchControlComponent {
@Input()
searchTerm = '';
@@ -77,21 +74,15 @@ export class AlfrescoSearchControlComponent implements AfterViewInit {
this.searchControl.valueChanges.map(value => this.searchControl.valid ? value : '')
.debounceTime(400).distinctUntilChanged().subscribe(
(value: string) => {
this.autocompleteSearchTerm = value;
this.searchValid = this.searchControl.valid;
}
);
(value: string) => {
this.autocompleteSearchTerm = value;
this.searchValid = this.searchControl.valid;
}
);
translate.addTranslationFolder('node_modules/ng2-alfresco-search/dist/src');
}
ngAfterViewInit(): void {
if (componentHandler) {
componentHandler.upgradeAllRegistered();
}
}
getTextFieldClassName(): string {
return 'mdl-textfield mdl-js-textfield' + (this.expandable ? ' mdl-textfield--expandable' : '');
}