ng-semantic
Version:
Angular2 building blocks based on Semantic UI
25 lines (19 loc) • 663 B
text/typescript
import { Directive, ViewContainerRef, Input, OnInit } from "@angular/core";
declare var jQuery: any;
/**
* Implementation of Semantic UI popup
*
* @link http://semantic-ui.com/modules/popup.html
*/
({
selector: "[smDirTooltip]"
})
export class SMTooltipDirective implements OnInit {
() smDirTooltip: string;
() smDirPosition: string;
constructor(public element: ViewContainerRef) {}
ngOnInit(): void {
this.element.element.nativeElement.setAttribute("data-position", this.smDirPosition || "top center");
this.element.element.nativeElement.setAttribute("data-tooltip", this.smDirTooltip);
}
}