11import { Component , OnInit , ViewEncapsulation } from '@angular/core' ;
2- import { ActivatedRoute , Router , ROUTES } from '@angular/router' ;
2+ import { ActivatedRoute , Router } from '@angular/router' ;
33
4- declare var ng : any ;
4+ declare var window : any ;
55
66@Component ( {
77 selector : 'app-blog' ,
@@ -11,7 +11,26 @@ declare var ng: any;
1111 encapsulation : ViewEncapsulation . Emulated ,
1212} )
1313export class BlogComponent implements OnInit {
14- ngOnInit ( ) { }
14+ ngOnInit ( ) {
15+ // if (window && !window.PrismLoading) {
16+ // window.PrismLoading = true;
17+ // if (window.Prism) {
18+ // /** already loaded nothing to do here.. */
19+ // return;
20+ // }
21+ // /** load prism to do syntax highlighting */
22+ // const lnk = document.createElement('link');
23+ // lnk.href = 'https://cdn.jsdelivr.net/npm/prismjs@1.19.0/themes/prism-twilight.css';
24+ // lnk.rel = 'stylesheet';
25+ // document.head.appendChild(lnk);
26+ // const prism = document.createElement('script');
27+ // prism.src = 'https://cdn.jsdelivr.net/npm/prismjs@1.19.0/prism.min.js';
28+ // document.head.appendChild(prism);
29+ // const prismLoad = document.createElement('script');
30+ // prismLoad.src = 'https://cdn.jsdelivr.net/npm/prismjs@1.19.0/prism.min.js';
31+ // document.head.appendChild(prismLoad);
32+ // }
33+ }
1534
1635 constructor ( private router : Router , private route : ActivatedRoute ) { }
1736}
0 commit comments