Skip to content

Commit

Permalink
version 0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
orizens committed Dec 2, 2017
1 parent 8fdb44e commit 7369dba
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
30 changes: 13 additions & 17 deletions example/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@ import { ListMaker } from './list.service';
providers: [ListMaker],
styleUrls: ['./style.css'],
template: `
<h1 class="title well">
<section>
<small>items: {{sum}}, now triggering scroll: {{direction}}</small>
</section>
</h1>
<div class="fixed dummy">
<div>DUMMY</div>
<div *ngFor="let item of items">{{ item }}</div>
</div>
<test-inner className="fixed inner" [scrollWindow]="false" [selector]="'.content'" [fromRoot]="false"
[info]="'selector inside: .content'"></test-inner>
<test className="fixed third" [scrollWindow]="true" info="'listen to window'"></test>
<test className="fixed second" [scrollWindow]="false" [selector]="'.dummy'" [fromRoot]="true"></test>
<test className="fixed first" [scrollWindow]="false"></test>
<test className="search-results"></test>
`
<div class="fixed dummy">
<div>DUMMY</div>
<div *ngFor="let item of items">{{ item }}</div>
</div>
<test className="fixed third" info="'listen to window'" [throttle]="300"></test>
<test-inner className="fixed inner" [scrollWindow]="false" [selector]="'.content'" [fromRoot]="false"
[info]="'selector inside: .content'"></test-inner>
<test className="fixed with-error" [scrollWindow]="false" [selector]="'.not-found'"></test>
<test className="fixed second" [scrollWindow]="false" [selector]="'.dummy'" [fromRoot]="true"></test>
<test className="fixed first" [scrollWindow]="false"></test>
<test className="search-results"></test>
`
})
export class AppComponent {
public items = this.listMaker.array;
constructor(public listMaker: ListMaker) {}
constructor(public listMaker: ListMaker) { }
}
10 changes: 5 additions & 5 deletions example/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { ListMaker } from './list.service';
[infiniteScrollThrottle]="throttle"
(scrolled)="onScrollDown()"
(scrolledUp)="onUp()">
<h3 class="info">
{{ className }}, {{info}}
<input type="checkbox" name="_disable" [(ngModel)]="disableScroll" title="disables scroll">
</h3>
<h4 class="info">
{{ className }}, {{info}}<br>
disable scroll <input type="checkbox" name="_disable" [(ngModel)]="disableScroll" title="disables scroll">
</h4>
<p *ngFor="let i of array">
{{ i }}
</p>
Expand All @@ -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;

Expand Down
9 changes: 7 additions & 2 deletions example/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -47,6 +47,11 @@
background-color: darkslategrey;
}

.with-error {
top: 0;
right: 220px;
background-color: gray;
}
.inner {
bottom: 0;
right: 600px;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/services/ngx-ins-utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as console from 'console';
import { ElementRef, SimpleChange } from '@angular/core';

export function resolveContainerElement(
Expand All @@ -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;
}
Expand Down

0 comments on commit 7369dba

Please sign in to comment.