Skip to content

Commit 6f33c71

Browse files
committed
Improve documentation for RouterService and mount helper
Fixes #15622
1 parent 9654d2a commit 6f33c71

File tree

2 files changed

+56
-2
lines changed

2 files changed

+56
-2
lines changed

packages/ember-glimmer/lib/syntax/mount.js

+24-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,32 @@ function dynamicEngineFor(vm, args, meta) {
2727
{{mount "ember-chat"}}
2828
```
2929
30-
Currently, the engine name is the only argument that can be passed to
31-
`{{mount}}`.
30+
Additionally, you can also pass in a `model` argument that will be
31+
set as the engines model. This can be an existing object:
32+
33+
```
34+
<div>
35+
{{mount 'admin' model=userSettings}}
36+
</div>
37+
```
38+
39+
Or an inline `hash`, and you can even pass components:
40+
41+
42+
```
43+
<div>
44+
<h1>Application template!</h1>
45+
{{mount 'admin' model=(hash
46+
title='Secret Admin'
47+
signInButton=(component 'sign-in-button')
48+
)}}
49+
</div>
50+
```
3251
3352
@method mount
53+
@param {String} name Name of the engine to mount.
54+
@param {Object} [model] Object that will be set as
55+
the model of the engine.
3456
@for Ember.Templates.helpers
3557
@category ember-application-engines
3658
@public

packages/ember-routing/lib/services/router.js

+32
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,41 @@ import { shallowEqual } from '../utils';
1818
@category ember-routing-router-service
1919
*/
2020
const RouterService = Service.extend({
21+
22+
/**
23+
Name of the current route.
24+
25+
@property currentRouteName
26+
@type String
27+
@public
28+
*/
2129
currentRouteName: readOnly('_router.currentRouteName'),
30+
31+
/**
32+
Current URL for the application.
33+
34+
@property currentURL
35+
@type String
36+
@public
37+
*/
2238
currentURL: readOnly('_router.currentURL'),
39+
40+
/**
41+
Location object for the application.
42+
43+
@property location
44+
@type String
45+
@public
46+
*/
2347
location: readOnly('_router.location'),
48+
49+
/**
50+
Root URL of the current application.
51+
52+
@property rootURL
53+
@type String
54+
@public
55+
*/
2456
rootURL: readOnly('_router.rootURL'),
2557
_router: null,
2658

0 commit comments

Comments
 (0)