ng-include includes inline template

Description

The following code shows how to use ng-include to include an inline template.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--   ww w . ja va 2 s . co m-->
<body>
  <div ng-app="">
  <script type="text/ng-template" id="/tpl.html">
      I am from a template.
  </script>
  <ng-include src="'/tpl.html'"></ng-include>
</div>  
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities