mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-30 19:34:42 +00:00
doc(ng:include): improve the doc example to avoid confusion
This commit is contained in:
parent
a0b35161a6
commit
da464683aa
3 changed files with 12 additions and 8 deletions
1
docs/examples/ng-include/template1.html
Normal file
1
docs/examples/ng-include/template1.html
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Content of template1.html
|
||||||
1
docs/examples/ng-include/template2.html
Normal file
1
docs/examples/ng-include/template2.html
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Content of template2.html
|
||||||
|
|
@ -824,21 +824,23 @@ angularWidget('select', function(element){
|
||||||
<doc:example>
|
<doc:example>
|
||||||
<doc:source>
|
<doc:source>
|
||||||
<select name="url">
|
<select name="url">
|
||||||
<option value="api/angular.filter.date.html">date filter</option>
|
<option value="examples/ng-include/template1.html">template1.html</option>
|
||||||
<option value="api/angular.filter.html.html">html filter</option>
|
<option value="examples/ng-include/template2.html">template2.html</option>
|
||||||
<option value="">(blank)</option>
|
<option value="">(blank)</option>
|
||||||
</select>
|
</select>
|
||||||
<tt>url = <a href="{{url}}">{{url}}</a></tt>
|
url of the template: <tt><a href="{{url}}">{{url}}</a></tt>
|
||||||
<hr/>
|
<hr/>
|
||||||
<ng:include src="url"></ng:include>
|
<ng:include src="url"></ng:include>
|
||||||
</doc:source>
|
</doc:source>
|
||||||
<doc:scenario>
|
<doc:scenario>
|
||||||
it('should load date filter', function(){
|
it('should load template1.html', function(){
|
||||||
expect(element('.doc-example-live ng\\:include').text()).toMatch(/angular\.filter\.date/);
|
expect(element('.doc-example-live ng\\:include').text()).
|
||||||
|
toBe('Content of template1.html\n');
|
||||||
});
|
});
|
||||||
it('should change to html filter', function(){
|
it('should load template2.html', function(){
|
||||||
select('url').option('api/angular.filter.html.html');
|
select('url').option('examples/ng-include/template2.html');
|
||||||
expect(element('.doc-example-live ng\\:include').text()).toMatch(/angular\.filter\.html/);
|
expect(element('.doc-example-live ng\\:include').text()).
|
||||||
|
toBe('Content of template2.html\n');
|
||||||
});
|
});
|
||||||
it('should change to blank', function(){
|
it('should change to blank', function(){
|
||||||
select('url').option('');
|
select('url').option('');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue