diff --git a/lib/ngx-gist.ts b/lib/ngx-gist.ts index 4f0b492..924decb 100644 --- a/lib/ngx-gist.ts +++ b/lib/ngx-gist.ts @@ -1,28 +1,30 @@ -import {Component, Input, ViewChild, ElementRef, AfterViewInit} from '@angular/core'; +import { Component, Input, ViewChild, ElementRef, AfterViewInit, ViewEncapsulation } from '@angular/core'; @Component({ selector: 'ngx-gist', template:` - + `, - styleUrls: [] + styleUrls: [], + encapsulation: ViewEncapsulation.None }) export class NgxGist implements AfterViewInit { @ViewChild('iframe') iframe:ElementRef; @Input() gistId; + @Input() file:string; ngAfterViewInit() { + let fileName = (this.file) ? this.file : ''; this.iframe.nativeElement.id = 'gist-' + this.gistId; let doc = this.iframe.nativeElement.contentDocument || this.iframe.nativeElement.contentElement.contentWindow; - let content = ` - + let content = ` +