@@ -16,23 +16,23 @@ export class ColorsComponent implements OnInit, AfterViewInit {
1616
1717 public themeColors ( ) : void {
1818 Array . from ( this . document . querySelectorAll ( '.theme-color' ) ) . forEach (
19- // @ts -ignore
20- ( el : HTMLElement ) => {
21- const background = getStyle ( 'background-color' , el ) ;
19+ ( element : Element ) => {
20+ const htmlElement = element as HTMLElement ;
21+ const background = getStyle ( 'background-color' , htmlElement ) ?? '#fff' ;
2222 const table = this . renderer . createElement ( 'table' ) ;
2323 table . innerHTML = `
24- <table class=' table w-100' >
24+ <table class=" table w-100" >
2525 <tr>
26- <td class=' text-muted' >HEX:</td>
27- <td class=' font-weight-bold' >${ rgbToHex ( background ) } </td>
26+ <td class=" text-muted" >HEX:</td>
27+ <td class=" font-weight-bold" >${ rgbToHex ( background ) } </td>
2828 </tr>
2929 <tr>
30- <td class=' text-muted' >RGB:</td>
31- <td class=' font-weight-bold' >${ background } </td>
30+ <td class=" text-muted" >RGB:</td>
31+ <td class=" font-weight-bold" >${ background } </td>
3232 </tr>
3333 </table>
3434 ` ;
35- this . renderer . appendChild ( el . parentNode , table ) ;
35+ this . renderer . appendChild ( htmlElement . parentNode , table ) ;
3636 // @ts -ignore
3737 // el.parentNode.appendChild(table);
3838 }
@@ -49,8 +49,8 @@ export class ColorsComponent implements OnInit, AfterViewInit {
4949@Component ( {
5050 selector : 'app-theme-color' ,
5151 template : `
52- <c-col xl='2' md='4' sm='6' xs='12' class=' my-4 ms-4' >
53- <div [ngClass]=' colorClasses' style=' padding-top: 75%;' ></div>
52+ <c-col xl="2" md="4" sm="6" xs="12" class=" my-4 ms-4" >
53+ <div [ngClass]=" colorClasses" style=" padding-top: 75%;" ></div>
5454 <ng-content></ng-content>
5555 </c-col>
5656 `
0 commit comments