https://docs.angularjs.org/api/ng/directive/script
angularjs也支持script形式的template

<script type="text/ng-template" >
  Content of the template.
</script>

<a ng-click="currentTpl='/tpl.html'" >Load inlined template</a>
<div ></div>
it('should load template defined inside script tag', function() {
  element(by.css('#tpl-link')).click();
  expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);
});

相关文章: