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 = ` + - - + + `; diff --git a/package.json b/package.json index 3682f89..eb67921 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "rxjs": "^5.0.3", "semantic-release": "^6.3.2", "tslint": "^5.1.0", - "typescript": "^2.1.5", + "typescript": "^2.4.2", "ts-helpers": "^1.1.2", "ts-node": "^3.0.2", "uglify-js": "^2.8.22",