refactor(all): enable strictPropertyInitialization

This commit is contained in:
Manu Mtz.-Almeida
2018-04-19 18:48:38 +02:00
parent 78bd146ad2
commit 4ea8881f33
129 changed files with 1513 additions and 1664 deletions

View File

@ -8,9 +8,10 @@ import { Component, Element, Event, EventEmitter, Prop } from '@stencil/core';
}
})
export class SelectOption {
id: string;
@Element() el: HTMLElement;
private inputId = `ion-selopt-${selectOptionIds++}`;
@Element() el!: HTMLElement;
/**
* If true, the user cannot interact with the select option. Defaults to `false`.
@ -20,29 +21,25 @@ export class SelectOption {
/**
* If true, the element is selected.
*/
@Prop({ mutable: true }) selected = false;
@Prop() selected = false;
/**
* The text value of the option.
*/
@Prop({ mutable: true }) value: string;
@Prop({ mutable: true }) value!: string;
/**
* Emitted when the select option loads.
*/
@Event() ionSelectOptionDidLoad: EventEmitter;
@Event() ionSelectOptionDidLoad!: EventEmitter;
/**
* Emitted when the select option unloads.
*/
@Event() ionSelectOptionDidUnload: EventEmitter;
constructor() {
this.id = 'ion-selopt-' + (selectOptionIds++);
}
@Event() ionSelectOptionDidUnload!: EventEmitter;
componentWillLoad() {
if (this.value == null) {
if (this.value === undefined) {
this.value = this.el.textContent || '';
}
}
@ -58,7 +55,7 @@ export class SelectOption {
hostData() {
return {
'role': 'option',
'id': this.id
'id': this.inputId
};
}