Skip to content

Commit 6b9edb5

Browse files
author
Jack Matthews
authored
Merge pull request #4 from thisissoon/feature/docs-update
docs(app): Docs updated to reflect new event functionality
2 parents df4dcf2 + 2ba048a commit 6b9edb5

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4.
66

7-
A simple progressive/responsive/lazy loading image library for [Angular (2/4+)][angular] that detects browser size and loads the appropriate image only when the element is in view. This package requires [angular-inviewport][angular-inviewport]
7+
A simple progressive/responsive/lazy loading image library for [Angular (2/4+)][angular] that detects browser size and loads the appropriate image only when the element is in view. Classes are attributed and events emited on image loads. This package requires [angular-inviewport][angular-inviewport].
88

99
<img src="https://raw.githubusercontent.com/thisissoon/angular-image-loader/master/src/assets/example.gif" alt="example">
1010

@@ -39,12 +39,19 @@ export class AppModule { }
3939

4040
## Example
4141

42-
a working example can be found inside [/src](https://github.com/thisissoon/angular-image-loader/tree/master/src) folder
42+
A working example can be found inside [/src](https://github.com/thisissoon/angular-image-loader/tree/master/src) folder.
4343

4444
### `app.component.html`
4545

4646
```html
47-
<sn-image-loader [image]="image" [sizes]="sizes" imgClass="foo" alt="lorem ipsum"></sn-image-loader>
47+
<sn-image-loader
48+
[image]="image"
49+
[sizes]="sizes"
50+
imgClass="foo"
51+
alt="lorem ipsum"
52+
(imagePlaceholderLoaded)="onPlaceholderLoad($event)"
53+
(imageLoaded)="onFullResLoad($event)">
54+
</sn-image-loader>
4855
```
4956

5057
### `app.component.ts`
@@ -73,6 +80,14 @@ export class AppComponent {
7380
'@2x': 'http://via.placeholder.com/1400x800?text=lg+2x'
7481
}
7582
};
83+
84+
public onPlaceholderLoad(imageLoadedEvent: ImageLoadedEvent) {
85+
// Do something
86+
}
87+
88+
public onFullResLoad(imageLoadedEvent: ImageLoadedEvent) {
89+
// Do something
90+
}
7691
}
7792
```
7893

0 commit comments

Comments
 (0)