Update index.js

Denis Bondarenko changed to support templates, inlined with script tag like ...type="text/ng-template"
better prechars handling including ng-template script