Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 + Use custom implementation instead of not known prepend on server side
  • Loading branch information
EnricoMessall committed Oct 20, 2024
1 parent df5d575 commit 09443df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/components/usestyle/usestyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export class UseStyle {
nonce,
});

first ? this.document.head.prepend(styleRef) : this.document.head.appendChild(styleRef);
const head = this.document.head || this.document.getElementsByTagName('head')[0];
if (first) {
head.insertBefore(styleRef, head.firstChild);
} else {
head.appendChild(styleRef);
}
DomHandler.setAttribute(styleRef, 'data-primeng-style-id', name);
}

Expand Down

0 comments on commit 09443df

Please sign in to comment.