diff --git a/ng2-components/ng2-alfresco-search/README.md b/ng2-components/ng2-alfresco-search/README.md index e1e6479985..9bcff08f8e 100644 --- a/ng2-components/ng2-alfresco-search/README.md +++ b/ng2-components/ng2-alfresco-search/README.md @@ -91,7 +91,8 @@ Also make sure you include these dependencies in your .html page: ```html + (searchChange)="onSearchChange($event);" + (searchSubmit)="onSearchSubmit($event);"> ``` @@ -116,7 +117,7 @@ import { @Component({ selector: 'alfresco-search-demo', template: ` - +
Authentication failed to ip {{ host }} @@ -141,11 +142,15 @@ class SearchDemo implements OnInit { translation.addTranslationFolder(); } - searchTermChange(event) { + onSearchChange(event) { console.log('Search term changed', event); this.searchTerm = event.value; } + onSearchSubmit(event) { + console.log('Search submitted', event); + } + ngOnInit() { this.login(); } @@ -165,7 +170,8 @@ bootstrap(SearchDemo, [ ``` #### Events -**searchChange**: Emitted when the search term is changed and the form submitted, provided that the term is at least three characters in length
+**searchChange**: Emitted when the search term is changed. The search term is provided in the 'value' property of the returned object. If the term is at less than three characters in length then the term is truncated to an empty string.
+**searchSubmit**: Emitted when the search form is submitted. The search term is provided in the 'value' property of the returned object.
#### Options @@ -220,7 +226,7 @@ Also make sure you include these dependencies in your .html page: ``` Example of an component that displays search results, using the Angular2 router to supply a 'q' parameter containing the -search term. If no router is present pon the page of if the router does not provide such a parameter then an empty +search term. If no router is present on the page of if the router does not provide such a parameter then an empty results page will be shown. ```ts @@ -242,7 +248,7 @@ import { @Component({ selector: 'alfresco-search-demo', template: ` - +
Authentication failed to ip {{ host }}
@@ -266,11 +272,6 @@ class SearchDemo implements OnInit { translation.addTranslationFolder(); } - searchTermChange(event) { - console.log('Search term changed', event); - this.searchTerm = event.value; - } - ngOnInit() { this.login(); }