Skip to content

Commit d6d6b58

Browse files
committed
docs(ImageLoader): fixed example code in README.md
1 parent a71c3b3 commit d6d6b58

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
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]
66

7+
<img src="https://raw.githubusercontent.com/thisissoon/angular-image-loader/master/src/demo/example.gif" alt="example">
8+
79
This is a simple library for [Angular][angular], implemented in the [Angular Package Format v4.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx).
810

911

@@ -24,18 +26,24 @@ export class AppModule { }
2426
```
2527

2628

27-
## Examples
29+
## Example
30+
31+
a working example can be found inside [/src/demo](https://github.com/thisissoon/angular-image-loader/tree/master/src/demo) folder
32+
33+
### `app.component.html`
2834

2935
```html
3036
<sn-image-loader [image]="image" [sizes]="sizes" imgClass="foo" alt="lorem ipsum"></sn-image-loader>
3137
```
3238

39+
### `app.component.ts`
40+
3341
```ts
3442
export class AppComponent {
3543
sizes: Breakpoint[] = [
36-
{ size: Size.XS, width: 0},
37-
{ size: Size.MD, width: 768},
38-
{ size: Size.LG, width: 992},
44+
{ size: 'xs', width: 0},
45+
{ size: 'md', width: 768},
46+
{ size: 'lg', width: 992},
3947
];
4048

4149
image: ResponsiveImage = {
@@ -57,16 +65,18 @@ export class AppComponent {
5765
}
5866
```
5967

68+
### `app.component.css`
69+
6070
```css
6171
.foo {
6272
transition: all .35s ease-in-out;
6373
}
6474

65-
.sn-image-not-loaded .foo {
75+
.sn-image-not-loaded /deep/ .foo {
6676
filter: blur(20px);
6777
}
6878

69-
.sn-image-loaded .foo {
79+
.sn-image-loaded /deep/ .foo {
7080
filter: blur(0px);
7181
}
7282
```

src/demo/example.gif

297 KB
Loading

0 commit comments

Comments
 (0)