File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1- import { CommonModule } from '@angular/common' ;
2- import { Component } from '@angular/core' ;
1+ import { CommonModule , isPlatformBrowser } from '@angular/common' ;
2+ import { Component , Inject , PLATFORM_ID } from '@angular/core' ;
33import { RouterOutlet } from '@angular/router' ;
44import { NgbModule } from '@ng-bootstrap/ng-bootstrap' ;
55
@@ -14,5 +14,18 @@ import { FooterComponent } from './shared/footer';
1414 standalone : true
1515} )
1616export class AppComponent {
17+ constructor ( @Inject ( PLATFORM_ID ) private platformId : Object ) {
18+ this . loadPlausible ( ) ;
19+ }
1720
21+ loadPlausible ( ) {
22+ // Ensure we are in the browser (not SSR)
23+ if ( isPlatformBrowser ( this . platformId ) ) {
24+ const script = document . createElement ( 'script' ) ;
25+ script . src = 'https://plausible.cluster.dev.meshcloud.io/js/script.js' ;
26+ script . setAttribute ( 'data-domain' , 'hub.meshcloud.io' ) ;
27+ script . defer = true ;
28+ document . head . appendChild ( script ) ;
29+ }
30+ }
1831}
You can’t perform that action at this time.
0 commit comments