11# Angular Image Loader
2+
23[ ![ Build Status] [ travis-badge ]] [ travis-badge-url ]
34[ ![ Coverage Status] [ coveralls-badge ]] [ coveralls-badge-url ]
45[ ![ Commitizen friendly] [ commitizen-badge ]] [ commitizen ]
6+ [ ![ code style: prettier] [ prettier-badge ]] [ prettier-badge-url ]
57
68This project was generated with [ Angular CLI] [ angular-cli ] version 1.5.4.
79
@@ -11,7 +13,6 @@ A simple progressive/responsive/lazy loading image library for [Angular][angular
1113
1214This is a simple library for [ Angular] [ angular ] , implemented in the [ Angular Package Format v5.0] [ apfv5 ] .
1315
14-
1516## Install
1617
1718### via NPM
@@ -20,11 +21,15 @@ This is a simple library for [Angular][angular], implemented in the [Angular Pac
2021
2122### via Yarn
2223
23- ` yarn add @thisissoon/angular-image-loader @thisissoon/angular-inviewport `
24+ ` yarn add @thisissoon/angular-image-loader @thisissoon/angular-inviewport `
2425
2526` app.module.ts `
27+
2628``` ts
27- import { ImageLoaderModule , VideoLoaderModule } from ' @thisissoon/angular-image-loader' ;
29+ import {
30+ ImageLoaderModule ,
31+ VideoLoaderModule
32+ } from ' @thisissoon/angular-image-loader' ;
2833import { InViewportModule , WindowRef } from ' @thisissoon/angular-inviewport' ;
2934
3035// Provide window object for platform browser
@@ -39,10 +44,11 @@ export const providers: Provider[] = [
3944 VideoLoaderModule // Only this import required if using just the video loader
4045 ]
4146})
42- export class AppModule { }
47+ export class AppModule {}
4348```
4449
4550` app.server.module.ts ` (Only needed if using Angular Universal)
51+
4652``` ts
4753import { ImageLoaderModule } from ' @thisissoon/angular-image-loader' ;
4854import { InViewportModule , WindowRef } from ' @thisissoon/angular-inviewport' ;
@@ -55,10 +61,9 @@ import { InViewportModule, WindowRef } from '@thisissoon/angular-inviewport';
5561 VideoLoaderModule
5662 ]
5763})
58- export class AppModule { }
64+ export class AppModule {}
5965```
6066
61-
6267## Image Loader Example
6368
6469A working example can be found inside [ /src] ( https://github.com/thisissoon/angular-image-loader/tree/master/src ) folder.
@@ -83,7 +88,7 @@ export class AppComponent {
8388 sizes: Breakpoint [] = [
8489 { size: ' xs' , width: 0 },
8590 { size: ' md' , width: 768 },
86- { size: ' lg' , width: 992 },
91+ { size: ' lg' , width: 992 }
8792 ];
8893
8994 image: ResponsiveImage = {
@@ -122,7 +127,7 @@ export class AppComponent {
122127
123128``` css
124129.foo {
125- transition : all .35s ease-in-out ;
130+ transition : all 0 .35s ease-in-out ;
126131}
127132
128133.sn-image-not-loaded ::ng-deep .img {
@@ -174,22 +179,25 @@ export class AppComponent {
174179 sizes: Breakpoint [] = [
175180 { size: ' xs' , width: 0 },
176181 { size: ' md' , width: 768 },
177- { size: ' lg' , width: 992 },
182+ { size: ' lg' , width: 992 }
178183 ];
179184
180185 video: ResponsiveVideo = {
181186 videos: [
182187 {
183188 size: ' xs' ,
184- url: ' http://res.cloudinary.com/thisissoon/video/upload/ac_none,c_fill,h_568,q_80,w_320/v1517616795/demos/jellyfish-25-mbps-hd-hevc.mp4'
189+ url:
190+ ' http://res.cloudinary.com/thisissoon/video/upload/ac_none,c_fill,h_568,q_80,w_320/v1517616795/demos/jellyfish-25-mbps-hd-hevc.mp4'
185191 },
186192 {
187193 size: ' md' ,
188- url: ' http://res.cloudinary.com/thisissoon/video/upload/ac_none,c_fill,h_1024,q_80,w_768/v1517616795/demos/jellyfish-25-mbps-hd-hevc.mp4'
194+ url:
195+ ' http://res.cloudinary.com/thisissoon/video/upload/ac_none,c_fill,h_1024,q_80,w_768/v1517616795/demos/jellyfish-25-mbps-hd-hevc.mp4'
189196 },
190197 {
191198 size: ' lg' ,
192- url: ' http://res.cloudinary.com/thisissoon/video/upload/ac_none,c_fill,h_720,q_80,w_1280/v1517616795/demos/jellyfish-25-mbps-hd-hevc.mp4'
199+ url:
200+ ' http://res.cloudinary.com/thisissoon/video/upload/ac_none,c_fill,h_720,q_80,w_1280/v1517616795/demos/jellyfish-25-mbps-hd-hevc.mp4'
193201 }
194202 ],
195203 poster: {
@@ -199,7 +207,6 @@ export class AppComponent {
199207}
200208```
201209
202-
203210### Check inviewport status manually
204211
205212``` html
@@ -220,7 +227,6 @@ export class AppComponent {
220227<button (click) =" videoEl.checkInViewportStatus()" >Check status</button >
221228```
222229
223-
224230## Development server
225231
226232Run ` ng serve ` for a dev server. Navigate to ` http://localhost:4200/ ` . The app will automatically reload if you change any of the source files.
@@ -249,24 +255,24 @@ This repo uses [Commitizen CLI][commitizen] and [Conventional Changelog][convent
249255
250256Run ` npm run release ` to create a new release. This will use [ Standard Version] [ standard-version ] to create a new release. [ Standard Version] [ standard-version ] will generate / update the changelog based on commits generated using [ Commitizen CLI] [ commitizen ] , update the version number following semantic versioning rules and then commit and tag the commit for the release. Simply run ` git push --follow-tags origin master ` .
251257
252-
253258## Further help
254259
255260To get more help on the Angular CLI use ` ng help ` or go check out the [ Angular CLI README] [ angular-cli-readme ] .
256261
257-
258262[ travis-badge ] : https://travis-ci.org/thisissoon/angular-image-loader.svg?branch=master
259263[ travis-badge-url ] : https://travis-ci.org/thisissoon/angular-image-loader
260264[ coveralls-badge ] : https://coveralls.io/repos/github/thisissoon/angular-image-loader/badge.svg?branch=master
261265[ coveralls-badge-url ] : https://coveralls.io/github/thisissoon/angular-image-loader?branch=master
266+ [ prettier-badge ] : https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=shield
267+ [ prettier-badge-url ] : https://github.com/prettier/prettier
262268[ angular ] : https://angular.io/
263269[ angular-inviewport ] : https://github.com/thisissoon/angular-inviewport
264- [ commitizen ] :http://commitizen.github.io/cz-cli/
265- [ commitizen-badge ] :https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
266- [ conventional-changelog ] :https://github.com/conventional-changelog/conventional-changelog
267- [ standard-version ] :https://github.com/conventional-changelog/standard-version
268- [ karma ] :https://karma-runner.github.io
269- [ protractor ] :http://www.protractortest.org/
270- [ angular-cli ] :https://github.com/angular/angular-cli
271- [ angular-cli-readme ] :https://github.com/angular/angular-cli/blob/master/README.md
272- [ apfv5 ] :(https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx)
270+ [ commitizen ] : http://commitizen.github.io/cz-cli/
271+ [ commitizen-badge ] : https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
272+ [ conventional-changelog ] : https://github.com/conventional-changelog/conventional-changelog
273+ [ standard-version ] : https://github.com/conventional-changelog/standard-version
274+ [ karma ] : https://karma-runner.github.io
275+ [ protractor ] : http://www.protractortest.org/
276+ [ angular-cli ] : https://github.com/angular/angular-cli
277+ [ angular-cli-readme ] : https://github.com/angular/angular-cli/blob/master/README.md
278+ [ apfv5 ] : (https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx)
0 commit comments