Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular-image-loader"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "sn",
"styles": [
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {}
}
}
52 changes: 46 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
# http://editorconfig.org
# ____ __ __ __ _
# / ___) / \ / \ ( ( \
# \___ \( O )( O )/ / ____
# (____/ \__/ \__/ \_)__)(____)
#
# SOON_ Cross team root editorconfig configuration
# Projects can also have a local .editorconfig to customise syntax
#

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

# Backend Languages (Python, Go, Ruby etc)

# Python
[*.py]
indent_style = space
indent_size = 4
line_length=80
multi_line_output=3
default_section=THIRDPARTY
import_heading_stdlib=Standard Libs
import_heading_thirdparty=Third Party Libs
import_heading_firstparty=First Party Libs
lines_after_imports=2

# Ruby
[{*.rb,Vagrantfile}]
indent_style = space
indent_size = 2
insert_final_newline = true

# Front End Languages (HTML, JS/TS, CSS etc)

[*.{js, ts, css, html}]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true

## JS/TS
[*.{js, ts}]
quote_type = single

# Misc

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
# YAML Based files - 2 space indent
[*.{yml, yaml, sls}]
indent_style = space
indent_size = 2
54 changes: 41 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
.DS_STORE
dist/
node_modules/
out-tsc/
debug.log
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
src/**/*.js
!src/demo/systemjs.config.js
!src/demo/systemjs.config.lib.js
!**/*systemjs-angular-loader.js
*.js.map
e2e/**/*.js
e2e/**/*.js.map
coverage
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ before_install:
# Install latest chrome.
- export CHROME_BIN=chromium-browser
install:
- npm install
- npm install --no-progress
script:
- npm run lint
- npm run test:once
- npm run integration
- npm run test -- --no-progress --code-coverage --single-run --browser=ChromeNoSandbox
- npm run e2e -- --no-progress
- npm run coverage
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2014-2016 Google, Inc.
Copyright (c) 2017 SOON London Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
[![Build Status][travis-badge]][travis-badge-url]
[![Coverage Status][coveralls-badge]][coveralls-badge-url]

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

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]

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

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).
This is a simple library for [Angular][angular], implemented in the [Angular Package Format v5.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx).


## Install
Expand All @@ -16,9 +18,18 @@ This is a simple library for [Angular][angular], implemented in the [Angular Pac
`app.module.ts`
```ts
import { ImageLoaderModule } from '@thisissoon/angular-image-loader';
import { InViewportModule, WindowRef } from '@thisissoon/angular-inviewport';

// Provide window object for browser and a suitable replacement
// on other platforms
export const getWindow = () => window;
export const providers: Provider[] = [
{ provide: WindowRef, useFactory: (getWindow) }
];

@NgModule({
imports: [
InViewportModule.forRoot(providers),
ImageLoaderModule
]
})
Expand All @@ -28,7 +39,7 @@ export class AppModule { }

## Example

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

### `app.component.html`

Expand Down Expand Up @@ -82,6 +93,31 @@ export class AppComponent {
```


## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).


[travis-badge]: https://travis-ci.org/thisissoon/angular-image-loader.svg?branch=master
[travis-badge-url]: https://travis-ci.org/thisissoon/angular-image-loader
[coveralls-badge]: https://coveralls.io/repos/github/thisissoon/angular-image-loader/badge.svg?branch=master
Expand Down
10 changes: 0 additions & 10 deletions bs-config.json

This file was deleted.

Loading