ng-semantic
Version:
Angular2 building blocks based on Semantic UI
28 lines (24 loc) • 786 B
text/typescript
import { Component, Input, ChangeDetectionStrategy, ViewChild, ElementRef, AfterViewInit } from "@angular/core";
/**
* Implementation of List collection
*
* @link http://semantic-ui.com/elements/list.html
*/
({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: "sm-list",
template: `
<div class="ui list {{class}}" #innerElement>
<ng-content></ng-content>
</div>
`
})
export class SemanticListComponent implements AfterViewInit {
() class: string;
("innerElement") innerElement: ElementRef;
ngAfterViewInit() {
Array.from(this.innerElement.nativeElement.childNodes)
.filter((element: Element) => element.nodeName === "SM-LIST")
.map((element: Element) => element.firstElementChild.classList.remove("ui"));
}
}