Directive to insert button in mat-paginator: icon not rendering

68 views Asked by At

I want to insert a button between "previous page" and "next page" in a mat-paginator component, and for that I wrote a directive that does the job of injecting the paginator and its DOM reference, and doing the proper insertions using Angular's Renderer2. It works, with exception of these two fails:

  • SVG icon is not rendered (button works but appears blank) (solved, see edit);
  • ToolTip is not shown.

Could someone take a look and tell what I'm missing? Thanks in advance.

Link to my code in StackBlitz

EDIT

The problem with icon not rendering was solved by adding the 'svg' namespace to elements <svg> and <path> (thanks, reddit).

1

There are 1 answers

0
VBobCat On

I managed to solve by creating a new MatToolTip on the fly.

Check solution on StackBlitz, please look at the constructor's parameters and the attachMatToolTip() method.

Any improvement suggestions are more than welcome!