5

This post goes into detail how to bind loading template partials on events.

But what if I wanted to load template partials on page load similair to a templating engine like Smarty?

For example in Smarty:

<html>
<body>
{include file="templates/header.html"}
<span>Dude, this has too be possible in Angular JS...</span>
{include file="templates/footer.html"}
</body>
</html>
Community
  • 1
  • 1
Dan Kanze
  • 18,385
  • 28
  • 80
  • 133

1 Answers1

9

You can use the ngInclude directive. The documentation and an example can be found here: http://docs.angularjs.org/api/ng.directive:ngInclude

Wouter
  • 1,210
  • 2
  • 15
  • 22