-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/load event #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9e22532 to
6e868c7
Compare
e2e/app.e2e-spec.ts
Outdated
|
|
||
| }); | ||
|
|
||
| describe('iamge loaded', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo here
src/app/app.component.ts
Outdated
| * Incremented on each image load event. | ||
| * | ||
| * @type {number} | ||
| * @memberof ImageLoaderComponent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should be AppComponent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
| (inViewportChange)="onInViewportChange($event)" | ||
| [debounce]="0"> | ||
| [debounce]="0" | ||
| (load)="onImageLoad(image)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the argument for the event handler needs to be $event like on line 8
| * @memberof ImageLoaderComponent | ||
| */ | ||
| public onImageLoad(image: ResponsiveImage): void { | ||
| this.imageLoaded.emit(image); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking do we need to emit the image load event when the placeholder is loaded? is it useful?
6e868c7 to
43e7e1d
Compare
… use by the image loader compon
…nt added for placeholder image BREAKING CHANGE: The inputs and outputs to the image-loader component have changed
…ader component to match updated BREAKING CHANGE: image-loader components updated inputs and outputs implemented
…mage-loader component functiona
comments have been addressed
…e by srcSet attribute. Prevents tests from running before the next image is loaded.
src/app/app.component.html
Outdated
| imgClass="foo" | ||
| alt="lorem ipsum" | ||
| (placeholderLoaded)="onPlaceholderLoad($event)" | ||
| (fullResLoaded)="onFullResLoad($event)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be very clear and specific and call these events imageLoaded and imagePlaceholderLoaded as fullResLoaded sounds ambiguous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
| * @memberof ImageLoaderComponent | ||
| */ | ||
| @Output() | ||
| public fullResLoaded: EventEmitter<ImageLoadedEvent> = new EventEmitter<ImageLoadedEvent>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here i would be clear and specific and call this imageLoaded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
…fullResLoaded updated to imageL BREAKING CHANGE: Variable name changes affect the image-loader component API
Suggestions implemented
Implemented
imageLoadedevent chain