diff --git a/demos/component-docs/action-sheets/basic/basic.html b/demos/component-docs/action-sheets/basic/basic.html index 72198d0602..4d17f50a40 100644 --- a/demos/component-docs/action-sheets/basic/basic.html +++ b/demos/component-docs/action-sheets/basic/basic.html @@ -1,4 +1,4 @@ - + Action Sheet diff --git a/demos/component-docs/action-sheets/basic/pages.ts b/demos/component-docs/action-sheets/basic/pages.ts index 20a7e6da02..e412dd31bf 100644 --- a/demos/component-docs/action-sheets/basic/pages.ts +++ b/demos/component-docs/action-sheets/basic/pages.ts @@ -23,43 +23,57 @@ export class BasicPage { if (this.platform.is('android')) { var androidSheet = { - + title: 'Albums', buttons: [ - { text: 'Share', icon: 'share' }, - { text: 'Play', icon: 'arrow-dropright-circle'}, - { text: 'Favorite', icon: 'ion-md-heart-outline'} + { text: 'Share', + handler: buttonHandler, + icon: 'share' + }, + { text: 'Play', + handler: buttonHandler, + icon: 'arrow-dropright-circle' + }, + { text: 'Favorite', + handler: buttonHandler, + icon: 'ion-md-heart-outline' + }, + { + text: 'Delete', + style: 'destructive', + handler: () => { + console.log('Destructive clicked'); + } + }, + { + text: 'Cancel', + style: 'cancel', + handler: () => { + console.log('Cancel clicked'); + } + } ], - destructiveText: 'Delete', - titleText: 'Albums', - cancelText: 'Cancel', - cancel: function() { - console.log('Canceled'); - }, - destructiveButtonClicked: () => { - console.log('Destructive clicked'); - }, - buttonClicked: function(index) { - console.log('Button clicked', index); - if (index == 1) { return false; } - return true; - } }; } - this.actionSheet = ActionSheet.create(androidSheet || { - title: 'Albums', + let actionSheet = ActionSheet.create( androidSheet || { buttons: [ { text: 'Share', - handler: buttonHandler + handler: () => { + console.log('Share clicked'); + } }, { text: 'Play', - handler: buttonHandler + handler: () => { + console.log('Play clicked'); + } }, { text: 'Favorite', - handler: buttonHandler + handler: () => { + console.log('Favorite clicked'); + } }, { text: 'Delete', @@ -72,18 +86,17 @@ export class BasicPage { text: 'Cancel', style: 'cancel', handler: () => { - console.log('Canceled'); + console.log('Cancel clicked'); } } - ], - + ] }); - this.nav.present(this.actionSheet); + this.nav.present(actionSheet); } onPageWillLeave() { - this.actionSheet && this.actionSheet.dismiss(); + actionSheet && actionSheet.dismiss(); } } diff --git a/demos/component-docs/popups/popups.ts b/demos/component-docs/alerts/alerts.ts similarity index 100% rename from demos/component-docs/popups/popups.ts rename to demos/component-docs/alerts/alerts.ts diff --git a/demos/component-docs/alerts/basic/pages.ts b/demos/component-docs/alerts/basic/pages.ts new file mode 100644 index 0000000000..f932a49cde --- /dev/null +++ b/demos/component-docs/alerts/basic/pages.ts @@ -0,0 +1,84 @@ +import {Page, Alert, NavController} from 'ionic/ionic'; +import {AndroidAttribute} from '../../helpers'; +import {forwardRef} from 'angular2/core'; + + +@Page({ + templateUrl: 'alerts/basic/template.html', + directives: [forwardRef(() => AndroidAttribute)] +}) +export class BasicPage { + + constructor(nav: NavController) { + this.nav = nav; + } + + doAlert() { + let alert = Alert.create({ + title: 'New Friend!', + subTitle: 'Your friend, Obi wan Kenobi, just accepted your friend request!', + buttons: ['Ok'] + }); + this.nav.present(alert); + } + + doPrompt() { + Baasbox Javascript SDK + let prompt = Alert.create({ + title: 'Login', + body: "Enter a name for this new album you're so keen on adding", + inputs: [ + { + name: 'title', + placeholder: 'Title' + }, + ], + buttons: [ + { + text: 'Cancel', + handler: data => { + console.log('Cancel clicked'); + } + }, + { + text: 'Save', + handler: data => { + console.log('Saved clicked'); + } + } + ] + }); + this.nav.present(prompt); + } + + doConfirm() { + let confirm = Alert.create({ + title: 'Use this lightsaber?', + body: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?', + buttons: [ + { + text: 'Disagree', + handler: () => { + console.log('Disagree clicked'); + } + }, + { + text: 'Agree', + handler: () => { + console.log('Agree clicked'); + } + } + ] + }); + this.nav.present(confirm); + } + + // onPageWillLeave() { + // let popup = this.popup.get(); + // // only try to close if there is an active popup + // if (popup) { + // popup.close(); + // } + // } + +} diff --git a/demos/component-docs/popups/basic/template.html b/demos/component-docs/alerts/basic/template.html similarity index 80% rename from demos/component-docs/popups/basic/template.html rename to demos/component-docs/alerts/basic/template.html index 771bec071d..5bd75d8b7e 100644 --- a/demos/component-docs/popups/basic/template.html +++ b/demos/component-docs/alerts/basic/template.html @@ -1,5 +1,5 @@ - + Popups diff --git a/demos/component-docs/badge/basic/template.html b/demos/component-docs/badge/basic/template.html index b8056f08b3..77965ece5a 100644 --- a/demos/component-docs/badge/basic/template.html +++ b/demos/component-docs/badge/basic/template.html @@ -1,5 +1,5 @@ - + Badge diff --git a/demos/component-docs/buttons/basic/basic.html b/demos/component-docs/buttons/basic/basic.html index 4ad97cbf5c..05318b4ef3 100644 --- a/demos/component-docs/buttons/basic/basic.html +++ b/demos/component-docs/buttons/basic/basic.html @@ -1,4 +1,4 @@ - + Buttons diff --git a/demos/component-docs/buttons/block/block.html b/demos/component-docs/buttons/block/block.html index 2942033b74..b79d49e5f5 100644 --- a/demos/component-docs/buttons/block/block.html +++ b/demos/component-docs/buttons/block/block.html @@ -1,4 +1,4 @@ - + Block Buttons diff --git a/demos/component-docs/buttons/clear/clear.html b/demos/component-docs/buttons/clear/clear.html index 859fab2326..dc0545ec46 100644 --- a/demos/component-docs/buttons/clear/clear.html +++ b/demos/component-docs/buttons/clear/clear.html @@ -1,4 +1,4 @@ - + Clear Buttons diff --git a/demos/component-docs/buttons/components/components.html b/demos/component-docs/buttons/components/components.html index bfd9d6ad00..0107b17e31 100644 --- a/demos/component-docs/buttons/components/components.html +++ b/demos/component-docs/buttons/components/components.html @@ -1,4 +1,4 @@ - + Buttons diff --git a/demos/component-docs/buttons/fab/fab.html b/demos/component-docs/buttons/fab/fab.html index 6392467eba..7cb7266880 100644 --- a/demos/component-docs/buttons/fab/fab.html +++ b/demos/component-docs/buttons/fab/fab.html @@ -1,4 +1,4 @@ - + FAB diff --git a/demos/component-docs/buttons/full/full.html b/demos/component-docs/buttons/full/full.html index a6a0e609dd..0aee380cd7 100644 --- a/demos/component-docs/buttons/full/full.html +++ b/demos/component-docs/buttons/full/full.html @@ -1,4 +1,4 @@ - + Full Buttons diff --git a/demos/component-docs/buttons/icons/icons.html b/demos/component-docs/buttons/icons/icons.html index eebb3ee74f..0ae1d1771d 100644 --- a/demos/component-docs/buttons/icons/icons.html +++ b/demos/component-docs/buttons/icons/icons.html @@ -1,5 +1,5 @@ - + Icon Buttons diff --git a/demos/component-docs/buttons/outline/outline.html b/demos/component-docs/buttons/outline/outline.html index 929272f7a6..68a7de7ea2 100644 --- a/demos/component-docs/buttons/outline/outline.html +++ b/demos/component-docs/buttons/outline/outline.html @@ -1,4 +1,4 @@ - + Outline Buttons diff --git a/demos/component-docs/buttons/round/round.html b/demos/component-docs/buttons/round/round.html index e044fde8de..788cad03e9 100644 --- a/demos/component-docs/buttons/round/round.html +++ b/demos/component-docs/buttons/round/round.html @@ -1,4 +1,4 @@ - + Round Buttons diff --git a/demos/component-docs/buttons/sizes/sizes.html b/demos/component-docs/buttons/sizes/sizes.html index cb13ca485c..d3e5bd42ac 100644 --- a/demos/component-docs/buttons/sizes/sizes.html +++ b/demos/component-docs/buttons/sizes/sizes.html @@ -1,4 +1,4 @@ - + Button Sizes diff --git a/demos/component-docs/cards/advanced-map/template.html b/demos/component-docs/cards/advanced-map/template.html index 2aba3b99e5..2a19d91eb7 100644 --- a/demos/component-docs/cards/advanced-map/template.html +++ b/demos/component-docs/cards/advanced-map/template.html @@ -1,5 +1,5 @@ - + Map Card diff --git a/demos/component-docs/cards/advanced-social/template.html b/demos/component-docs/cards/advanced-social/template.html index 7dc6514471..ad7248df65 100644 --- a/demos/component-docs/cards/advanced-social/template.html +++ b/demos/component-docs/cards/advanced-social/template.html @@ -1,5 +1,5 @@ - + Social Card diff --git a/demos/component-docs/cards/advanced-weather/template.html b/demos/component-docs/cards/advanced-weather/template.html index 36ce2bab6d..fe7ea96692 100644 --- a/demos/component-docs/cards/advanced-weather/template.html +++ b/demos/component-docs/cards/advanced-weather/template.html @@ -1,5 +1,5 @@ - + Weather Card diff --git a/demos/component-docs/cards/background/template.html b/demos/component-docs/cards/background/template.html index 91f0e4e9f4..3327ae7620 100644 --- a/demos/component-docs/cards/background/template.html +++ b/demos/component-docs/cards/background/template.html @@ -1,5 +1,5 @@ - + Background Images diff --git a/demos/component-docs/cards/basic/template.html b/demos/component-docs/cards/basic/template.html index cc5439bce7..48c9d56808 100644 --- a/demos/component-docs/cards/basic/template.html +++ b/demos/component-docs/cards/basic/template.html @@ -1,5 +1,5 @@ - + Basic Cards diff --git a/demos/component-docs/cards/header/template.html b/demos/component-docs/cards/header/template.html index 0b30caaeec..f9a9fa3733 100644 --- a/demos/component-docs/cards/header/template.html +++ b/demos/component-docs/cards/header/template.html @@ -1,5 +1,5 @@ - + Card Headers diff --git a/demos/component-docs/cards/image/template.html b/demos/component-docs/cards/image/template.html index cb22295da1..f4e55d4c3b 100644 --- a/demos/component-docs/cards/image/template.html +++ b/demos/component-docs/cards/image/template.html @@ -1,5 +1,5 @@ - + Card Images diff --git a/demos/component-docs/cards/list/template.html b/demos/component-docs/cards/list/template.html index d76f762600..dfa012d59d 100644 --- a/demos/component-docs/cards/list/template.html +++ b/demos/component-docs/cards/list/template.html @@ -1,5 +1,5 @@ - + Card Lists diff --git a/demos/component-docs/grid/basic/template.html b/demos/component-docs/grid/basic/template.html index e26b954bd2..6fa6738f9e 100644 --- a/demos/component-docs/grid/basic/template.html +++ b/demos/component-docs/grid/basic/template.html @@ -1,5 +1,5 @@ - + Grid diff --git a/demos/component-docs/helpers.ts b/demos/component-docs/helpers.ts index 9ae0db33f4..6df008b63b 100644 --- a/demos/component-docs/helpers.ts +++ b/demos/component-docs/helpers.ts @@ -13,7 +13,7 @@ import * as lists from './lists/lists'; import * as menus from './menus/menus'; import * as modals from './modals/modals'; import * as navigation from './navigation/navigation'; -import * as popups from './popups/popups'; +import * as alerts from './alerts/alerts'; import * as slides from './slides/slides'; import * as tabs from './tabs/tabs'; @@ -72,6 +72,8 @@ export function getPageFor(hash) { return { 'overview': actionSheets.BasicPage, 'action-sheets': actionSheets.BasicPage, + 'alert': alerts.BasicPage, + 'badges': badges.BasicPage, 'buttons': buttons.BasicPage, @@ -100,8 +102,9 @@ export function getPageFor(hash) { 'range': inputs.RangePage, 'segment': inputs.SegmentPage, 'select': inputs.SelectPage, - 'switch': inputs.SwitchPage, 'searchbar': inputs.SearchPage, + 'toggle': inputs.TogglePage, + 'inputs': labels.BasicPage, 'fixed-inline-labels': labels.FixedInlinePage, @@ -127,7 +130,6 @@ export function getPageFor(hash) { 'menus': menus.BasicPage, 'modals': modals.BasicPage, 'navigation': navigation.BasicPage, - 'popups': popups.BasicPage, 'slides': slides.BasicPage, 'tabs': tabs.BasicPage, diff --git a/demos/component-docs/icons/basic/template.html b/demos/component-docs/icons/basic/template.html index e68e87b4d3..59b6bbe249 100644 --- a/demos/component-docs/icons/basic/template.html +++ b/demos/component-docs/icons/basic/template.html @@ -1,5 +1,5 @@ - + Icons diff --git a/demos/component-docs/index.ts b/demos/component-docs/index.ts index 1823f3079c..988788dcc4 100644 --- a/demos/component-docs/index.ts +++ b/demos/component-docs/index.ts @@ -36,8 +36,6 @@ class DemoApp { window.addEventListener('message', (e) => { //TODO(@drewrygh) - e = {}; - e.data = '{}'; zone.run(() => { if (e.data) { var data; diff --git a/demos/component-docs/inputs/checkbox/template.html b/demos/component-docs/inputs/checkbox/template.html index 55adaa2c66..79c85fd339 100644 --- a/demos/component-docs/inputs/checkbox/template.html +++ b/demos/component-docs/inputs/checkbox/template.html @@ -1,4 +1,4 @@ - + Checkbox diff --git a/demos/component-docs/inputs/inputs.ts b/demos/component-docs/inputs/inputs.ts index e8c13a52a9..d0d84fe13a 100644 --- a/demos/component-docs/inputs/inputs.ts +++ b/demos/component-docs/inputs/inputs.ts @@ -4,4 +4,4 @@ export * from './range/pages'; export * from './search/pages'; export * from './segment/pages'; export * from './select/pages'; -export * from './switch/pages'; +export * from './toggle/pages'; diff --git a/demos/component-docs/inputs/radio/template.html b/demos/component-docs/inputs/radio/template.html index 975aeec920..cc03c4f1d4 100644 --- a/demos/component-docs/inputs/radio/template.html +++ b/demos/component-docs/inputs/radio/template.html @@ -1,4 +1,4 @@ - + Radio diff --git a/demos/component-docs/inputs/range/template.html b/demos/component-docs/inputs/range/template.html index 1b0f0dfbd3..f2ab4661cb 100644 --- a/demos/component-docs/inputs/range/template.html +++ b/demos/component-docs/inputs/range/template.html @@ -1,4 +1,4 @@ - + Range diff --git a/demos/component-docs/inputs/search/template.html b/demos/component-docs/inputs/search/template.html index 96b3070a52..f02ae0ac12 100644 --- a/demos/component-docs/inputs/search/template.html +++ b/demos/component-docs/inputs/search/template.html @@ -1,4 +1,4 @@ - + Searchbar diff --git a/demos/component-docs/inputs/segment/template.html b/demos/component-docs/inputs/segment/template.html index c55ee419a7..9d750d8b0e 100644 --- a/demos/component-docs/inputs/segment/template.html +++ b/demos/component-docs/inputs/segment/template.html @@ -1,4 +1,4 @@ - + Segment diff --git a/demos/component-docs/inputs/select/template.html b/demos/component-docs/inputs/select/template.html index 4f1193b610..034d7de00b 100644 --- a/demos/component-docs/inputs/select/template.html +++ b/demos/component-docs/inputs/select/template.html @@ -1,4 +1,4 @@ - + Select diff --git a/demos/component-docs/inputs/switch/pages.ts b/demos/component-docs/inputs/toggle/pages.ts similarity index 74% rename from demos/component-docs/inputs/switch/pages.ts rename to demos/component-docs/inputs/toggle/pages.ts index b7b4e2c2b4..f84cd5329b 100644 --- a/demos/component-docs/inputs/switch/pages.ts +++ b/demos/component-docs/inputs/toggle/pages.ts @@ -3,10 +3,10 @@ import {forwardRef} from 'angular2/core'; import {AndroidAttribute} from '../../helpers'; @Page({ - templateUrl: 'inputs/switch/template.html', + templateUrl: 'inputs/toggle/template.html', directives: [forwardRef(() => AndroidAttribute)] }) -export class SwitchPage{ +export class TogglePage{ constructor() { } } diff --git a/demos/component-docs/inputs/switch/template.html b/demos/component-docs/inputs/toggle/template.html similarity index 92% rename from demos/component-docs/inputs/switch/template.html rename to demos/component-docs/inputs/toggle/template.html index f84f900273..6835b2ec0d 100644 --- a/demos/component-docs/inputs/switch/template.html +++ b/demos/component-docs/inputs/toggle/template.html @@ -1,7 +1,7 @@ - + - Switch + Toggle diff --git a/demos/component-docs/labels/basic/template.html b/demos/component-docs/labels/basic/template.html index dc50b20bc4..bbbe65869a 100644 --- a/demos/component-docs/labels/basic/template.html +++ b/demos/component-docs/labels/basic/template.html @@ -1,4 +1,4 @@ - + Forms diff --git a/demos/component-docs/labels/fixed-inline/template.html b/demos/component-docs/labels/fixed-inline/template.html index 3d8eca5b85..ce19b5eed8 100644 --- a/demos/component-docs/labels/fixed-inline/template.html +++ b/demos/component-docs/labels/fixed-inline/template.html @@ -1,4 +1,4 @@ - + Fixed Labels diff --git a/demos/component-docs/labels/floating/template.html b/demos/component-docs/labels/floating/template.html index 18d8a66040..3320e05bf4 100644 --- a/demos/component-docs/labels/floating/template.html +++ b/demos/component-docs/labels/floating/template.html @@ -1,4 +1,4 @@ - + Floating Labels diff --git a/demos/component-docs/labels/inline/template.html b/demos/component-docs/labels/inline/template.html index 91c2860271..f30d398460 100644 --- a/demos/component-docs/labels/inline/template.html +++ b/demos/component-docs/labels/inline/template.html @@ -1,4 +1,4 @@ - + Inline Labels diff --git a/demos/component-docs/labels/inset/template.html b/demos/component-docs/labels/inset/template.html index ef8f8a7cf1..0b8a85dfab 100644 --- a/demos/component-docs/labels/inset/template.html +++ b/demos/component-docs/labels/inset/template.html @@ -1,4 +1,4 @@ - + Inset Labels diff --git a/demos/component-docs/labels/placeholder/template.html b/demos/component-docs/labels/placeholder/template.html index 70077c672f..1a35dda6e8 100644 --- a/demos/component-docs/labels/placeholder/template.html +++ b/demos/component-docs/labels/placeholder/template.html @@ -1,4 +1,4 @@ - + Placeholders diff --git a/demos/component-docs/labels/stacked/template.html b/demos/component-docs/labels/stacked/template.html index aba3e71703..3e6dc94189 100644 --- a/demos/component-docs/labels/stacked/template.html +++ b/demos/component-docs/labels/stacked/template.html @@ -1,4 +1,4 @@ - + Stacked Labels diff --git a/demos/component-docs/lists/avatar/template.html b/demos/component-docs/lists/avatar/template.html index 2b123424cf..10d726f8a5 100644 --- a/demos/component-docs/lists/avatar/template.html +++ b/demos/component-docs/lists/avatar/template.html @@ -1,5 +1,5 @@ - + Avatar List diff --git a/demos/component-docs/lists/basic/template.html b/demos/component-docs/lists/basic/template.html index 30cfe30c3a..fc4053e541 100644 --- a/demos/component-docs/lists/basic/template.html +++ b/demos/component-docs/lists/basic/template.html @@ -1,5 +1,5 @@ - + Lists diff --git a/demos/component-docs/lists/headers/template.html b/demos/component-docs/lists/headers/template.html index 7c45b75720..05c5203263 100644 --- a/demos/component-docs/lists/headers/template.html +++ b/demos/component-docs/lists/headers/template.html @@ -1,5 +1,5 @@ - + List Headers diff --git a/demos/component-docs/lists/icon/template.html b/demos/component-docs/lists/icon/template.html index ab2e9207a3..e2f4fa2a2a 100644 --- a/demos/component-docs/lists/icon/template.html +++ b/demos/component-docs/lists/icon/template.html @@ -1,5 +1,5 @@ - + Icon List diff --git a/demos/component-docs/lists/inset/template.html b/demos/component-docs/lists/inset/template.html index 4461c248a8..77ba1cc7c5 100644 --- a/demos/component-docs/lists/inset/template.html +++ b/demos/component-docs/lists/inset/template.html @@ -1,5 +1,5 @@ - + Inset List diff --git a/demos/component-docs/lists/multiline/template.html b/demos/component-docs/lists/multiline/template.html index c9e4143f68..674f4137ac 100644 --- a/demos/component-docs/lists/multiline/template.html +++ b/demos/component-docs/lists/multiline/template.html @@ -1,5 +1,5 @@ - + Multiline Items diff --git a/demos/component-docs/lists/no-lines/template.html b/demos/component-docs/lists/no-lines/template.html index 0d25485c0a..6ed056ded5 100644 --- a/demos/component-docs/lists/no-lines/template.html +++ b/demos/component-docs/lists/no-lines/template.html @@ -1,5 +1,5 @@ - + No Lines diff --git a/demos/component-docs/lists/thumbnail/template.html b/demos/component-docs/lists/thumbnail/template.html index f5cac55e31..a0833d434a 100644 --- a/demos/component-docs/lists/thumbnail/template.html +++ b/demos/component-docs/lists/thumbnail/template.html @@ -1,5 +1,5 @@ - + Thumbnails diff --git a/demos/component-docs/menus/basic/menu-events.html b/demos/component-docs/menus/basic/menu-events.html index 70cdb0cac0..a752f2dfff 100644 --- a/demos/component-docs/menus/basic/menu-events.html +++ b/demos/component-docs/menus/basic/menu-events.html @@ -1,5 +1,5 @@ - + ' + '', directives: [NgIf, forwardRef(() => InputScrollAssist), forwardRef(() => TextInputElement), Button] }) export class TextInput { - @ContentChild(forwardRef(() => TextInputElement)) textInputElement; - /** * @private */ @Input() clearInput: any; - - value: any = ''; + value: string = ''; constructor( - form: Form, - elementRef: ElementRef, config: Config, - renderer: Renderer, - app: IonicApp, - platform: Platform, - @Optional() @Host() scrollView: Content, - @Optional() navCtrl: NavController, + private _form: Form, + private _renderer: Renderer, + private _elementRef: ElementRef, + private _app: IonicApp, + private _platform: Platform, + @Optional() @Host() private _scrollView: Content, + @Optional() private _nav: NavController, @Attribute('floating-label') isFloating: string, @Attribute('stacked-label') isStacked: string, @Attribute('fixed-label') isFixed: string, @Attribute('inset') isInset: string ) { - this.renderer = renderer; - - this.form = form; - form.register(this); + _form.register(this); this.type = 'text'; this.lastTouch = 0; @@ -106,40 +220,44 @@ export class TextInput { // make more gud with pending @Attributes API this.displayType = (isFloating === '' ? 'floating' : (isStacked === '' ? 'stacked' : (isFixed === '' ? 'fixed' : (isInset === '' ? 'inset' : null)))); - this.app = app; - this.elementRef = elementRef; - this.platform = platform; - this.navCtrl = navCtrl; - - this.scrollView = scrollView; - this.scrollAssist = config.get('scrollAssist'); + this._assist = config.get('scrollAssist'); this.keyboardHeight = config.get('keyboardHeight'); } /** * @private - * This function is used to add the Angular css classes associated with inputs in forms */ - addNgClass(className) { - this.input && this.input.elementRef.nativeElement.classList.contains(className); - } + @ContentChild(TextInputElement) + set _setInput(textInputElement) { + if (textInputElement) { + textInputElement.addClass('item-input'); + if (this.displayType) { + textInputElement.addClass(this.displayType + '-input'); + } + this.input = textInputElement; + this.type = textInputElement.type; - /** - * @private - */ - registerInput(textInputElement) { - if (this.displayType) { - textInputElement.addClass(this.displayType + '-input'); + this.hasValue(this.input.value); + textInputElement.valueChange.subscribe(inputValue => { + this.hasValue(inputValue); + }); + + this.focusChange(this.hasFocus()); + textInputElement.focusChange.subscribe(hasFocus => { + this.focusChange(hasFocus); + }); + + } else { + console.error(' or