ng2-materialize
Version:
An Angular 2+ wrap around Materialize library
37 lines (36 loc) • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var MzCollectionComponent = (function () {
function MzCollectionComponent(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
}
MzCollectionComponent.prototype.ngOnInit = function () {
this.initElements();
this.initCollectionHeader();
};
MzCollectionComponent.prototype.initElements = function () {
this.collectionElement = $(this.elementRef.nativeElement).find('.collection');
this.collectionHeaderElement = $(this.elementRef.nativeElement).find('.collection-header');
};
MzCollectionComponent.prototype.initCollectionHeader = function () {
if (this.collectionHeaderElement.length > 0) {
this.renderer.addClass(this.collectionElement[0], 'with-header');
}
};
return MzCollectionComponent;
}());
MzCollectionComponent.decorators = [
{ type: core_1.Component, args: [{
selector: 'mz-collection',
template: "<div class=\"collection\"><ng-content></ng-content></div>",
styles: [""],
},] },
];
/** @nocollapse */
MzCollectionComponent.ctorParameters = function () { return [
{ type: core_1.ElementRef, },
{ type: core_1.Renderer2, },
]; };
exports.MzCollectionComponent = MzCollectionComponent;