mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1918] added new search api service to search component (#2667)
* [ADF-1918] added new search api service to search component * [ADF-1918] fixed close panel on empty search word * [ADF-1918] added documentation for search changes * [ADF-1918] fixed closing of subscription on destroy
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { SearchComponent } from '../search/components/search.component';
|
||||
import { QueryBody } from 'alfresco-js-api';
|
||||
|
||||
const entryItem = {
|
||||
entry: {
|
||||
@@ -117,7 +118,7 @@ export let errorJson = {
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<adf-search [searchTerm]="searchedWord" [maxResults]="maxResults"
|
||||
<adf-search [searchTerm]="searchedWord" [searchNode]="searchNode" [maxResults]="maxResults"
|
||||
(error)="showSearchResult('ERROR')"
|
||||
(success)="showSearchResult('success')" #search>
|
||||
<ng-template let-data>
|
||||
@@ -142,6 +143,7 @@ export let errorJson = {
|
||||
message: string = '';
|
||||
searchedWord= '';
|
||||
maxResults: number = 5;
|
||||
searchNode: QueryBody;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
@@ -158,6 +160,10 @@ export let errorJson = {
|
||||
this.searchedWord = str;
|
||||
}
|
||||
|
||||
setSearchNodeTo(searchNode: QueryBody) {
|
||||
this.searchNode = searchNode;
|
||||
}
|
||||
|
||||
changeMaxResultTo(newMax: number) {
|
||||
this.maxResults = newMax;
|
||||
}
|
||||
|
Reference in New Issue
Block a user