mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
11 lines
258 B
TypeScript
11 lines
258 B
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import * as hljs from 'highlight.js';
|
||
|
|
|
||
|
|
@Injectable()
|
||
|
|
export class NgxHighlightService {
|
||
|
|
|
||
|
|
public highlight(code: string): string {
|
||
|
|
return hljs.highlightAuto(code, ['ts', 'html', 'scss', 'nginx']).value;
|
||
|
|
}
|
||
|
|
}
|