From 7369dba90878440b9fbface84363687493f1a126 Mon Sep 17 00:00:00 2001 From: Oren Farhi Date: Sat, 2 Dec 2017 17:37:24 +0200 Subject: [PATCH] version 0.7.1 --- CHANGELOG.md | 3 +++ example/src/app.ts | 30 +++++++++++++----------------- example/src/test.ts | 10 +++++----- example/style.css | 9 +++++++-- package.json | 2 +- src/services/ngx-ins-utils.ts | 4 ++++ 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93b70c2c..46ea7e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v 0.7.1 (2017/11/27) +* [FIX] - use html container if passed in #217 - fix #216 + ## v 0.7.0 (2017/11/27) * [ADD] - watch changes for: infiniteScrollDisabled - fix #196 * [ADD] - watch changes for: infiniteScrollDistance - fix #202 diff --git a/example/src/app.ts b/example/src/app.ts index 44d77ba3..c02d6e1e 100644 --- a/example/src/app.ts +++ b/example/src/app.ts @@ -8,24 +8,20 @@ import { ListMaker } from './list.service'; providers: [ListMaker], styleUrls: ['./style.css'], template: ` -

-
- items: {{sum}}, now triggering scroll: {{direction}} -
-

-
-
DUMMY
-
{{ item }}
-
- - - - - - ` +
+
DUMMY
+
{{ item }}
+
+ + + + + + + ` }) export class AppComponent { public items = this.listMaker.array; - constructor(public listMaker: ListMaker) {} + constructor(public listMaker: ListMaker) { } } diff --git a/example/src/test.ts b/example/src/test.ts index 77e7bc09..7f3b6335 100644 --- a/example/src/test.ts +++ b/example/src/test.ts @@ -18,10 +18,10 @@ import { ListMaker } from './list.service'; [infiniteScrollThrottle]="throttle" (scrolled)="onScrollDown()" (scrolledUp)="onUp()"> -

- {{ className }}, {{info}} - -

+

+ {{ className }}, {{info}}
+ disable scroll +

{{ i }}

@@ -34,11 +34,11 @@ export class TestComponent { @Input() selector = null; @Input() fromRoot = false; @Input() info = ''; + @Input() throttle = 20; disableScroll = false; array = this.listMaker.array; - throttle = 20; scrollDistance = 3; scrollUpDistance = 2; diff --git a/example/style.css b/example/style.css index c6e14ddf..81a16d60 100644 --- a/example/style.css +++ b/example/style.css @@ -28,12 +28,12 @@ } .first { top: 0; - right: 0; + right: 20px; background-color: tomato; } .second { bottom: 0; - right: 0; + right: 0px; background-color: lime; } .dummy { @@ -47,6 +47,11 @@ background-color: darkslategrey; } +.with-error { + top: 0; + right: 220px; + background-color: gray; +} .inner { bottom: 0; right: 600px; diff --git a/package.json b/package.json index ff31204d..410362a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-infinite-scroll", - "version": "0.7.0", + "version": "0.7.1", "description": "An infinite scroll directive for Angular compatible with AoT compilation and Tree shaking", "main": "./bundles/ngx-infinite-scroll.umd.js", "module": "./modules/ngx-infinite-scroll.es5.js", diff --git a/src/services/ngx-ins-utils.ts b/src/services/ngx-ins-utils.ts index 85a84022..901466b6 100644 --- a/src/services/ngx-ins-utils.ts +++ b/src/services/ngx-ins-utils.ts @@ -1,3 +1,4 @@ +import * as console from 'console'; import { ElementRef, SimpleChange } from '@angular/core'; export function resolveContainerElement( @@ -14,6 +15,9 @@ export function resolveContainerElement( container = containerIsString ? findElement(selector, defaultElement.nativeElement, fromRoot) : selector; + if (!container) { + throw new Error('ngx-infinite-scroll {resolveContainerElement()}: selector for'); + } } return container; }