Search code examples
gitangulargithubgist

Setting up Github Highlighter in a Angular Page


I am trying to set this gist as highlighter in my Angular page. I was following this tutorial

http://robertgreiner.com/2012/04/using-github-as-a-syntax-highlighter/

But is just dosent seem to load to load it up in the template as with normal server side applications.

Do i need to put this to angular cli.json file ?

Sample gist -

<script src="https://gist.github.com/jhades/9c439200c392d4e32c5b28c1c8052d02.js"></script>


Solution

  • gist doesn't work directly with angular app like the way suggested in blog. In order to have gist working properly with angular app you need to embed your script & html code inside an iframe. You can try using ngx-gist (take look on component file) which you might can find useful. You can find npm package details here.