aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisko Hevery2011-07-18 10:42:42 -0700
committerMisko Hevery2011-07-26 09:40:29 -0700
commit0cf55353330e652e1bbb60f1eefee2b59cc9e8f6 (patch)
treedc0293d867858a9a9a42036d98b6f60b4902075b
parentfdd5d9471f3b330e3b941681c5b11e16e948da75 (diff)
downloadangular.js-0cf55353330e652e1bbb60f1eefee2b59cc9e8f6.tar.bz2
doc(ng:view): fix broken template links in docs; add scenario test.
-rw-r--r--src/widgets.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/widgets.js b/src/widgets.js
index f6de5f96..47869535 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -1261,9 +1261,12 @@ angularWidget("@ng:non-bindable", noop);
<doc:source>
<script>
function MyCtrl($route) {
- $route.when('/overview', {controller: OverviewCtrl, template: 'guide.overview.html'});
- $route.when('/bootstrap', {controller: BootstrapCtrl, template: 'guide.bootstrap.html'});
- console.log(window.$route = $route);
+ $route.when('/overview',
+ { controller: OverviewCtrl,
+ template: 'guide/dev_guide.overview.html'});
+ $route.when('/bootstrap',
+ { controller: BootstrapCtrl,
+ template: 'guide/dev_guide.bootstrap.auto_bootstrap.html'});
};
MyCtrl.$inject = ['$route'];
@@ -1271,13 +1274,25 @@ angularWidget("@ng:non-bindable", noop);
function OverviewCtrl(){}
</script>
<div ng:controller="MyCtrl">
- <a href="#/overview">overview</a> | <a href="#/bootstrap">bootstrap</a> | <a href="#/undefined">undefined</a><br/>
+ <a href="#/overview">overview</a> |
+ <a href="#/bootstrap">bootstrap</a> |
+ <a href="#/undefined">undefined</a>
+
+ <br/>
+
The view is included below:
<hr/>
<ng:view></ng:view>
</div>
</doc:source>
<doc:scenario>
+ it('should load templates', function(){
+ element('.doc-example-live a:contains(overview)').click();
+ expect(element('.doc-example-live ng\\:view').text()).toMatch(/Developer Guide: Overview/);
+
+ element('.doc-example-live a:contains(bootstrap)').click();
+ expect(element('.doc-example-live ng\\:view').text()).toMatch(/Developer Guide: Initializing Angular: Automatic Initiialization/);
+ });
</doc:scenario>
</doc:example>
*/