zcaudate
zcaudate

Reputation: 14258

how to load a template in the same file using ng-include?

I've seen an example this somewhere but now I can't find it in the docs or google

basically, I wish to define a template:

<script type="text/ng-template" id="loginform">....</script>

and then use it on the same page:

<div ng-include="'views/page/user.html#loginform'">

I've tried a couple of alternatives but its not working

Upvotes: 1

Views: 1985

Answers (1)

Neil
Neil

Reputation: 1299

You just need to omit the path from the src attribute e.g:

<div ng-include src="'loginform'"></div>

Upvotes: 4

Related Questions