Update index.js

A little change to support templates, inlined with script tag like ...type="text/ng-template"