UNPKG

2.42 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :
3 typeof define === 'function' && define.amd ? define('primeng/codehighlighter', ['exports', '@angular/core', '@angular/common'], factory) :
4 (global = global || self, factory((global.primeng = global.primeng || {}, global.primeng.codehighlighter = {}), global.ng.core, global.ng.common));
5}(this, (function (exports, core, common) { 'use strict';
6
7 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11 return c > 3 && r && Object.defineProperty(target, key, r), r;
12 };
13 var CodeHighlighter = /** @class */ (function () {
14 function CodeHighlighter(el) {
15 this.el = el;
16 }
17 CodeHighlighter.prototype.ngAfterViewInit = function () {
18 if (window['Prism']) {
19 window['Prism'].highlightElement(this.el.nativeElement);
20 }
21 };
22 CodeHighlighter.ctorParameters = function () { return [
23 { type: core.ElementRef }
24 ]; };
25 CodeHighlighter = __decorate([
26 core.Directive({
27 selector: '[pCode]'
28 })
29 ], CodeHighlighter);
30 return CodeHighlighter;
31 }());
32 var CodeHighlighterModule = /** @class */ (function () {
33 function CodeHighlighterModule() {
34 }
35 CodeHighlighterModule = __decorate([
36 core.NgModule({
37 imports: [common.CommonModule],
38 exports: [CodeHighlighter],
39 declarations: [CodeHighlighter]
40 })
41 ], CodeHighlighterModule);
42 return CodeHighlighterModule;
43 }());
44
45 exports.CodeHighlighter = CodeHighlighter;
46 exports.CodeHighlighterModule = CodeHighlighterModule;
47
48 Object.defineProperty(exports, '__esModule', { value: true });
49
50})));
51//# sourceMappingURL=primeng-codehighlighter.umd.js.map