diff --git a/ionic/components/searchbar/searchbar.ts b/ionic/components/searchbar/searchbar.ts index fa939a136c..bc8cea3cca 100644 --- a/ionic/components/searchbar/searchbar.ts +++ b/ionic/components/searchbar/searchbar.ts @@ -29,11 +29,9 @@ import {Button} from '../button/button'; inputs: [ 'cancelAction', 'hideCancelButton', - 'cancelButtonText' + 'cancelButtonText', + 'placeholder' ], - defaultInputs: { - 'placeholder': 'Search' - }, host: { '[class.searchbar-left-aligned]': 'shouldLeftAlign', '[class.searchbar-focused]': 'isFocused', @@ -45,7 +43,7 @@ import {Button} from '../button/button'; '' + '' + '' + - '', + '', directives: [FORM_DIRECTIVES, NgIf, NgClass, Icon, Button, forwardRef(() => SearchbarInput)] }) export class Searchbar extends Ion { @@ -73,13 +71,16 @@ export class Searchbar extends Ion { /** * @private - * On Initialization check for hideCancelButton + * On Initialization check for attributes */ ngOnInit() { let hideCancelButton = this.hideCancelButton; if (typeof hideCancelButton === 'string') { this.hideCancelButton = (hideCancelButton === '' || hideCancelButton === 'true'); } + + this.cancelButtonText = this.cancelButtonText || 'Cancel'; + this.placeholder = this.placeholder || 'Search'; } /**