Skip to content

Commit c83d8c6

Browse files
committed
doc(ng:view): fix broken template links in docs; add scenario test.
1 parent ad3b8d7 commit c83d8c6

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/widgets.js

+19-4
Original file line numberDiff line numberDiff line change
@@ -1261,23 +1261,38 @@ angularWidget("@ng:non-bindable", noop);
12611261
<doc:source>
12621262
<script>
12631263
function MyCtrl($route) {
1264-
$route.when('/overview', {controller: OverviewCtrl, template: 'guide.overview.html'});
1265-
$route.when('/bootstrap', {controller: BootstrapCtrl, template: 'guide.bootstrap.html'});
1266-
console.log(window.$route = $route);
1264+
$route.when('/overview',
1265+
{ controller: OverviewCtrl,
1266+
template: 'guide/dev_guide.overview.html'});
1267+
$route.when('/bootstrap',
1268+
{ controller: BootstrapCtrl,
1269+
template: 'guide/dev_guide.bootstrap.auto_bootstrap.html'});
12671270
};
12681271
MyCtrl.$inject = ['$route'];
12691272
12701273
function BootstrapCtrl(){}
12711274
function OverviewCtrl(){}
12721275
</script>
12731276
<div ng:controller="MyCtrl">
1274-
<a href="#/overview">overview</a> | <a href="#/bootstrap">bootstrap</a> | <a href="#/undefined">undefined</a><br/>
1277+
<a href="#/overview">overview</a> |
1278+
<a href="#/bootstrap">bootstrap</a> |
1279+
<a href="#/undefined">undefined</a>
1280+
1281+
<br/>
1282+
12751283
The view is included below:
12761284
<hr/>
12771285
<ng:view></ng:view>
12781286
</div>
12791287
</doc:source>
12801288
<doc:scenario>
1289+
it('should load templates', function(){
1290+
element('.doc-example-live a:contains(overview)').click();
1291+
expect(element('.doc-example-live ng\\:view').text()).toMatch(/Developer Guide: Overview/);
1292+
1293+
element('.doc-example-live a:contains(bootstrap)').click();
1294+
expect(element('.doc-example-live ng\\:view').text()).toMatch(/Developer Guide: Initializing Angular: Automatic Initiialization/);
1295+
});
12811296
</doc:scenario>
12821297
</doc:example>
12831298
*/

0 commit comments

Comments
 (0)