angular.widget.ng:include

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

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).

Usage

In HTML Template Binding

<ng:include src="..." [scope="..."] [onload="..."]></ng:include>

Parameters

Example

<select name="url"> <option value="angular.filter.date.html">date filter</option> <option value="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 ng\\:include').text()).toMatch(/angular\.filter\.date/); }); it('should change to hmtl filter', function(){ select('url').option('angular.filter.html.html'); expect(element('.doc-example ng\\:include').text()).toMatch(/angular\.filter\.html/); }); it('should change to blank', function(){ select('url').option('(blank)'); expect(element('.doc-example ng\\:include').text()).toEqual(''); });