Skip to content

Commit

Permalink
[DOC release] Improve documentation for RouterService and mount helper
Browse files Browse the repository at this point in the history
Fixes #15622
  • Loading branch information
locks committed Sep 3, 2017
1 parent 9654d2a commit 627a880
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
26 changes: 24 additions & 2 deletions packages/ember-glimmer/lib/syntax/mount.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,32 @@ function dynamicEngineFor(vm, args, meta) {
{{mount "ember-chat"}}
```
Currently, the engine name is the only argument that can be passed to
`{{mount}}`.
Additionally, you can also pass in a `model` argument that will be
set as the engines model. This can be an existing object:
```
<div>
{{mount 'admin' model=userSettings}}
</div>
```
Or an inline `hash`, and you can even pass components:
```
<div>
<h1>Application template!</h1>
{{mount 'admin' model=(hash
title='Secret Admin'
signInButton=(component 'sign-in-button')
)}}
</div>
```
@method mount
@param {String} name Name of the engine to mount.
@param {Object} [model] Object that will be set as
the model of the engine.
@for Ember.Templates.helpers
@category ember-application-engines
@public
Expand Down
32 changes: 32 additions & 0 deletions packages/ember-routing/lib/services/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,41 @@ import { shallowEqual } from '../utils';
@category ember-routing-router-service
*/
const RouterService = Service.extend({

/**
Name of the current route.
@property currentRouteName
@type String
@public
*/
currentRouteName: readOnly('_router.currentRouteName'),

/**
Current URL for the application.
@property currentURL
@type String
@public
*/
currentURL: readOnly('_router.currentURL'),

/**
Location object for the application.
@property location
@type String
@public
*/
location: readOnly('_router.location'),

/**
Root URL of the current application.
@property rootURL
@type String
@public
*/
rootURL: readOnly('_router.rootURL'),
_router: null,

Expand Down

0 comments on commit 627a880

Please sign in to comment.