Question: Angular ignores `script` tags in its template, but they are required to load GitHub gist. What is the best practice to do this? Using `iframe`? Creating `script` tag dynamically? Or something else?

Answer: 
One method is to create an `iframe` with `script` inside and append it whenever you want your gist to appear (based on [jasonhodges](https://github.com/jasonhodges/ngx-gist/blob/master/lib/ngx-gist.ts) solution).

Template
--------

```
 <iframe #iframe type="text/javascript"></iframe> 

```

Component
---------

```
@ViewChild('iframe') iframe: ElementRef;

gistUrl: string;

ngAfterViewInit() {
  const doc = this.iframe.nativeElement.contentDocument || this.iframe.nativeElement.contentElement.contentWindow;
    const content = `
        <html>
        <head>
          <base target="_parent">
        </head>
        <body>
        <script type="text/javascript" src="${this.gistUrl}"></script>
        </body>
      </html>
    `;
    doc.open();
    doc.write(content);
    doc.close();
}

```
I used [angular-gist-embed](https://github.com/pasupulaphani/angular-gist-embed) several times now using Bower to achieve this.

* Just install it like: `bower install angular-gist-embed`
* Then add it: `angular.module('myModule',['gist-embed'])`

And I use the particular GitHub Gist's id to embed it:

```
<code data-gist-id="5457595"></code>

```

You can find more examples [here](http://blairvanderhoof.com/gist-embed/).