I am trying to create directive which show a button when mouseover.
In angularJS I created an element by:
angular.element("<button mat-button></button>");
In angular5 Im trying to create element by:
button: any;
constructor(private el: ElementRef,
private renderer: Renderer2) {
this.createButton();
}
private createButton(){
this.button = this.renderer.createElement("button");
this.renderer.setAttribute(this.button,"mat-fab", "");
this.renderer.addClass(this.button, "mat-fab");
this.renderer.appendChild(this.el.nativeElement, this.button);
}
But unfortunatelly the button looks like regular button, not the material design button. It looks like renderer does not render the button but just insert some html without rendering.
Please help me.