top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is ng-include and when to use it?

0 votes
241 views
What is ng-include and when to use it?
posted Oct 20, 2017 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

ng-include is a directive which is used to include external HTML fragments from other files into the view's
HTML template.
For example, index.html file can be added inside the div element by using ng-include directive as an attribute.

<div ng-controller="MyCtrl">
 <div ng-include="'index.html'"></div>
</div>

ng-include directive is limited to load HTML fragments file from same domain but it doesn’t work for cross-domain
i.e. it can’t load the HTML fragments file from different domains.

answer Oct 20, 2017 by Shivaranjini
...