Include external HTML fragment.
Keep in mind that Same Origin Policy applies to included resources (e.g. ng:include won't work for file:// access).
<ng:include src="..." [scope="..."] [onload="..."]></ng:include>
src – {string} –
expression evaluating to URL.
scope(optional=new_child_scope) – {Scope} –
optional expression which evaluates to an instance of angular.scope to set the HTML fragment to.
onload(optional) – {string} –
Expression to evaluate when a new partial is loaded.
<select name="url"> <option value="api/angular.filter.date.html">date filter</option> <option value="api/angular.filter.html.html">html filter</option> <option value="">(blank)</option> </select> <tt>url = <a href="{{url}}">{{url}}</a></tt> <hr/> <ng:include src="url"></ng:include>
it('should load date filter', function(){ expect(element('.doc-example-live ng\\:include').text()).toMatch(/angular\.filter\.date/); }); it('should change to html filter', function(){ select('url').option('api/angular.filter.html.html'); expect(element('.doc-example-live ng\\:include').text()).toMatch(/angular\.filter\.html/); }); it('should change to blank', function(){ select('url').option(''); expect(element('.doc-example-live ng\\:include').text()).toEqual(''); });