feat(img): add ionImgWillLoad event and emit ionImgDidLoad when image is loaded (#18159)

- Adds `ionImgWillLoad` event that emits when the img src is set
- Moves the `ionImgDidLoad` event emit so that it happens when the image actually finishes loading

fixes #17652 closes #18161
This commit is contained in:
Vladimir Hinić
2019-05-01 16:03:16 -04:00
committed by Brandy Carney
parent 0e4726b62a
commit 38ffb98421
6 changed files with 25 additions and 6 deletions

View File

@ -1551,10 +1551,14 @@ export namespace Components {
*/
'onIonError'?: (event: CustomEvent<void>) => void;
/**
* Emitted when the img src has been set
* Emitted when the image has finished loading
*/
'onIonImgDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted when the img src has been set
*/
'onIonImgWillLoad'?: (event: CustomEvent<void>) => void;
/**
* The image URL. This attribute is mandatory for the <img> element.
*/
'src'?: string;