Search code examples
angularjspartial

Angular partial not rendering


I'm trying to render a partial in Angular, but it is not rendering. Am I missing something?

Partial here: <div ng-include="partial.html"></div>
<script type="text/ng-template" id="partial.html">
  test
</script>

Solution

  • ng-include expects an expression that results in a template url. If you need to pass a string, use quotes (in addition to the double-quotes of the attribute):

    <div ng-include="'partial.html'"></div>