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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions dist/lazyFor.directive.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Input, Directive, ViewContainerRef, TemplateRef, IterableDiffers } from '@angular/core';
var LazyForDirective = (function () {
var LazyForDirective = /** @class */ (function () {
function LazyForDirective(vcr, tpl, iterableDiffers) {
this.vcr = vcr;
this.tpl = tpl;
Expand Down Expand Up @@ -55,6 +55,8 @@ var LazyForDirective = (function () {
//Can't run the first update unless there is an element in the list
if (this.list.length === 0) {
this.vcr.clear();
this.beforeListElem.style.height = "0";
this.afterListElem.style.height = "0";
return;
}
if (this.firstUpdate) {
Expand Down Expand Up @@ -109,23 +111,23 @@ var LazyForDirective = (function () {
LazyForDirective.prototype.limitToRange = function (num, min, max) {
return Math.max(Math.min(num, max), min);
};
LazyForDirective.decorators = [
{ type: Directive, args: [{
selector: '[lazyFor]'
},] },
];
/** @nocollapse */
LazyForDirective.ctorParameters = function () { return [
{ type: ViewContainerRef, },
{ type: TemplateRef, },
{ type: IterableDiffers, },
]; };
LazyForDirective.propDecorators = {
'itemHeight': [{ type: Input, args: ['lazyForWithHeight',] },],
'containerElem': [{ type: Input, args: ['lazyForInContainer',] },],
'itemTagName': [{ type: Input, args: ['lazyForWithTagName',] },],
'lazyForOf': [{ type: Input },],
};
return LazyForDirective;
}());
export { LazyForDirective };
LazyForDirective.decorators = [
{ type: Directive, args: [{
selector: '[lazyFor]'
},] },
];
/** @nocollapse */
LazyForDirective.ctorParameters = function () { return [
{ type: ViewContainerRef, },
{ type: TemplateRef, },
{ type: IterableDiffers, },
]; };
LazyForDirective.propDecorators = {
'itemHeight': [{ type: Input, args: ['lazyForWithHeight',] },],
'containerElem': [{ type: Input, args: ['lazyForInContainer',] },],
'itemTagName': [{ type: Input, args: ['lazyForWithTagName',] },],
'lazyForOf': [{ type: Input },],
};
18 changes: 9 additions & 9 deletions dist/lazyFor.module.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { NgModule } from '@angular/core';
import { LazyForDirective } from './lazyFor.directive';
var LazyForModule = (function () {
var LazyForModule = /** @class */ (function () {
function LazyForModule() {
}
LazyForModule.decorators = [
{ type: NgModule, args: [{
declarations: [LazyForDirective],
exports: [LazyForDirective]
},] },
];
/** @nocollapse */
LazyForModule.ctorParameters = function () { return []; };
return LazyForModule;
}());
export { LazyForModule };
LazyForModule.decorators = [
{ type: NgModule, args: [{
declarations: [LazyForDirective],
exports: [LazyForDirective]
},] },
];
/** @nocollapse */
LazyForModule.ctorParameters = function () { return []; };
export { LazyForDirective };
2 changes: 2 additions & 0 deletions src/lazyFor.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export class LazyForDirective implements DoCheck {
//Can't run the first update unless there is an element in the list
if (this.list.length === 0) {
this.vcr.clear();
this.beforeListElem.style.height = "0";
this.afterListElem.style.height = "0";
return;
}

Expand Down