Skip to content

Commit

Permalink
addresses emberjs#2177
Browse files Browse the repository at this point in the history
  • Loading branch information
David Tang committed Jan 31, 2018
1 parent cef22a0 commit 7a0aa82
Show file tree
Hide file tree
Showing 40 changed files with 103 additions and 103 deletions.
4 changes: 2 additions & 2 deletions source/applications/applications-and-instances.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Every Ember application is represented by a class that extends [`Application`](https://emberjs.com/api/ember/2.16/classes/Application).
Every Ember application is represented by a class that extends [`Application`](https://emberjs.com/api/ember/release/classes/Application).
This class is used to declare and configure the many objects that make up your app.

As your application boots,
it creates an [`ApplicationInstance`](https://emberjs.com/api/ember/2.16/classes/ApplicationInstance) that is used to manage its stateful aspects.
it creates an [`ApplicationInstance`](https://emberjs.com/api/ember/release/classes/ApplicationInstance) that is used to manage its stateful aspects.
This instance acts as the "owner" of objects instantiated for your app.

Essentially, the `Application` *defines your application*
Expand Down
10 changes: 5 additions & 5 deletions source/applications/dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Ember applications utilize the [dependency injection](https://en.wikipedia.org/w
("DI") design pattern to declare and instantiate classes of objects and dependencies between them.
Applications and application instances each serve a role in Ember's DI implementation.

An [`Application`](https://emberjs.com/api/ember/2.16/classes/Application) serves as a "registry" for dependency declarations.
An [`Application`](https://emberjs.com/api/ember/release/classes/Application) serves as a "registry" for dependency declarations.
Factories (i.e. classes) are registered with an application,
as well as rules about "injecting" dependencies that are applied when objects are instantiated.

An [`ApplicationInstance`](https://emberjs.com/api/ember/2.16/classes/ApplicationInstance) serves as the "owner" for objects that are instantiated from registered factories.
An [`ApplicationInstance`](https://emberjs.com/api/ember/release/classes/ApplicationInstance) serves as the "owner" for objects that are instantiated from registered factories.
Application instances provide a means to "look up" (i.e. instantiate and / or retrieve) objects.

> _Note: Although an `Application` serves as the primary registry for an app,
Expand Down Expand Up @@ -194,7 +194,7 @@ export default Component.extend({
## Factory Instance Lookups

To fetch an instantiated factory from the running application you can call the
[`lookup`](https://emberjs.com/api/ember/2.16/classes/ApplicationInstance/methods/lookup?anchor=lookup) method on an application instance. This method takes a string
[`lookup`](https://emberjs.com/api/ember/release/classes/ApplicationInstance/methods/lookup?anchor=lookup) method on an application instance. This method takes a string
to identify a factory and returns the appropriate object.

```javascript
Expand Down Expand Up @@ -225,9 +225,9 @@ export default {

### Getting an Application Instance from a Factory Instance

[`Ember.getOwner`](https://emberjs.com/api/ember/2.16/classes/@ember%2Fapplication/methods/getOwner?anchor=getOwner) will retrieve the application instance that "owns" an
[`Ember.getOwner`](https://emberjs.com/api/ember/release/classes/@ember%2Fapplication/methods/getOwner?anchor=getOwner) will retrieve the application instance that "owns" an
object. This means that framework objects like components, helpers, and routes
can use [`Ember.getOwner`](https://emberjs.com/api/ember/2.16/classes/@ember%2Fapplication/methods/getOwner?anchor=getOwner) to perform lookups through their application
can use [`Ember.getOwner`](https://emberjs.com/api/ember/release/classes/@ember%2Fapplication/methods/getOwner?anchor=getOwner) to perform lookups through their application
instance at runtime.

For example, this component plays songs with different audio services based
Expand Down
8 changes: 4 additions & 4 deletions source/applications/run-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ $('a').click(() => {
});
```

The run loop API calls that _schedule_ work, i.e. [`run.schedule`](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Frunloop/methods/schedule?anchor=schedule),
[`run.scheduleOnce`](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Frunloop/methods/scheduleOnce?anchor=scheduleOnce),
[`run.once`](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Frunloop/methods/once?anchor=once) have the property that they will approximate a run loop for you if one does not already exist.
The run loop API calls that _schedule_ work, i.e. [`run.schedule`](https://www.emberjs.com/api/ember/release/classes/@ember%2Frunloop/methods/schedule?anchor=schedule),
[`run.scheduleOnce`](https://www.emberjs.com/api/ember/release/classes/@ember%2Frunloop/methods/scheduleOnce?anchor=scheduleOnce),
[`run.once`](https://www.emberjs.com/api/ember/release/classes/@ember%2Frunloop/methods/once?anchor=once) have the property that they will approximate a run loop for you if one does not already exist.
These automatically created run loops we call _autoruns_.

Here is some pseudocode to describe what happens using the example above:
Expand Down Expand Up @@ -265,5 +265,5 @@ Disabling autoruns help you identify these scenarios and helps both your testing

## Where can I find more information?

Check out the [Ember.run](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Frunloop) API documentation,
Check out the [Ember.run](https://www.emberjs.com/api/ember/release/classes/@ember%2Frunloop) API documentation,
as well as the [Backburner library](https://github.com/ebryn/backburner.js/) that powers the run loop.
6 changes: 3 additions & 3 deletions source/applications/services.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A [`Service`](https://www.emberjs.com/api/ember/2.16/modules/@ember%2Fservice) is an Ember object that lives for the duration of the application, and can be made available in different parts of your application.
A [`Service`](https://www.emberjs.com/api/ember/release/modules/@ember%2Fservice) is an Ember object that lives for the duration of the application, and can be made available in different parts of your application.

Services are useful for features that require shared state or persistent connections. Example uses of services might
include:
Expand All @@ -20,7 +20,7 @@ For example, the following command will create the `ShoppingCart` service:
ember generate service shopping-cart
```

Services must extend the [`Service`](https://www.emberjs.com/api/ember/2.16/modules/@ember%2Fservice) base class:
Services must extend the [`Service`](https://www.emberjs.com/api/ember/release/modules/@ember%2Fservice) base class:

```app/services/shopping-cart.js
import Service from '@ember/service';
Expand Down Expand Up @@ -92,7 +92,7 @@ This injects the shopping cart service into the component and makes it available

Sometimes a service may or may not exist, like when an initializer conditionally registers a service.
Since normal injection will throw an error if the service doesn't exist,
you must look up the service using Ember's [`getOwner`](https://emberjs.com/api/ember/2.16/classes/@ember%2Fapplication/methods/getOwner?anchor=getOwner) instead.
you must look up the service using Ember's [`getOwner`](https://emberjs.com/api/ember/release/classes/@ember%2Fapplication/methods/getOwner?anchor=getOwner) instead.

```app/components/cart-contents.js
import Component from '@ember/component';
Expand Down
6 changes: 3 additions & 3 deletions source/components/defining-a-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ the Handlebars template as described above and use the component that is
created.

If you need to customize the behavior of the component you'll
need to define a subclass of [`Component`](https://www.emberjs.com/api/ember/2.16/classes/Component). For example, you would
need to define a subclass of [`Component`](https://www.emberjs.com/api/ember/release/classes/Component). For example, you would
need a custom subclass if you wanted to change a component's element,
respond to actions from the component's template, or manually make
changes to the component's element using JavaScript.
Expand All @@ -71,7 +71,7 @@ file at `app/components/blog-post.js`. If your component was called

## Dynamically rendering a component

The [`{{component}}`](https://www.emberjs.com/api/ember/2.16/classes/Ember.Templates.helpers/methods/component?anchor=component) helper can be used to defer the selection of a component to
The [`{{component}}`](https://www.emberjs.com/api/ember/release/classes/Ember.Templates.helpers/methods/component?anchor=component) helper can be used to defer the selection of a component to
run time. The `{{my-component}}` syntax always renders the same component,
while using the `{{component}}` helper allows choosing a component to render on
the fly. This is useful in cases where you want to interact with different
Expand All @@ -81,7 +81,7 @@ allow you to keep different logic well separated.
The first parameter of the helper is the name of a component to render, as a
string. So `{{component 'blog-post'}}` is the same as using `{{blog-post}}`.

The real value of [`{{component}}`](https://www.emberjs.com/api/ember/2.16/classes/Ember.Templates.helpers/methods/component?anchor=component) comes from being able to dynamically pick
The real value of [`{{component}}`](https://www.emberjs.com/api/ember/release/classes/Ember.Templates.helpers/methods/component?anchor=component) comes from being able to dynamically pick
the component being rendered. Below is an example of using the helper as a
means of choosing different components for displaying different kinds of posts:

Expand Down
2 changes: 1 addition & 1 deletion source/components/handling-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ To utilize an `event` object as a function parameter:

The event handling examples described above respond to one set of events.
The names of the built-in events are listed below. Custom events can be
registered by using [Application.customEvents](https://www.emberjs.com/api/ember/2.16/classes/Application/properties/customEvents?anchor=customEvents).
registered by using [Application.customEvents](https://www.emberjs.com/api/ember/release/classes/Application/properties/customEvents?anchor=customEvents).

Touch events:

Expand Down
2 changes: 1 addition & 1 deletion source/components/passing-properties-to-a-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ In other words, you can invoke the above component example like this:
```

To set the component up to receive parameters this way, you need to
set the [`positionalParams`](https://www.emberjs.com/api/ember/2.16/classes/Component/properties/positionalParams?anchor=positionalParams) attribute in your component class.
set the [`positionalParams`](https://www.emberjs.com/api/ember/release/classes/Component/properties/positionalParams?anchor=positionalParams) attribute in your component class.

```app/components/blog-post.js
import Component from '@ember/component';
Expand Down
6 changes: 3 additions & 3 deletions source/components/the-component-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ There are a few things to note about the `didInsertElement()` hook:
- While [`didInsertElement()`][did-insert-element] is technically an event that can be listened for using `on()`, it is encouraged to override the default method itself,
particularly when order of execution is important.

[did-insert-element]: https://www.emberjs.com/api/ember/2.16/classes/Component/events/didInsertElement?anchor=didInsertElement
[dollar]: https://www.emberjs.com/api/ember/2.16/classes/Component/methods/$?anchor=%24
[did-insert-element]: https://www.emberjs.com/api/ember/release/classes/Component/events/didInsertElement?anchor=didInsertElement
[dollar]: https://www.emberjs.com/api/ember/release/classes/Component/methods/$?anchor=%24
[event-names]: http://guides.emberjs.com/v2.1.0/components/handling-events/#toc_event-names

### Making Updates to the Rendered DOM with `didRender`
Expand Down Expand Up @@ -254,7 +254,7 @@ export default Component.extend({

### Detaching and Tearing Down Component Elements with `willDestroyElement`

When a component detects that it is time to remove itself from the DOM, Ember will trigger the [`willDestroyElement()`](https://www.emberjs.com/api/ember/2.16/classes/Component/events/willDestroyElement?anchor=willDestroyElement) method,
When a component detects that it is time to remove itself from the DOM, Ember will trigger the [`willDestroyElement()`](https://www.emberjs.com/api/ember/release/classes/Component/events/willDestroyElement?anchor=willDestroyElement) method,
allowing for any teardown logic to be performed.

Component teardown can be triggered by a number of different conditions.
Expand Down
2 changes: 1 addition & 1 deletion source/components/wrapping-content-in-a-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ We will give them the option to specify either `markdown-style` or `html-style`.

Supporting different editing styles will require different body components to provide special validation and highlighting.
To load a different body component based on editing style,
you can yield the component using the [`component helper`](https://www.emberjs.com/api/ember/2.16/classes/Ember.Templates.helpers/methods/component?anchor=component) and [`hash helper`](https://www.emberjs.com/api/ember/2.16/classes/Ember.Templates.helpers/methods/hash?anchor=hash).
you can yield the component using the [`component helper`](https://www.emberjs.com/api/ember/release/classes/Ember.Templates.helpers/methods/component?anchor=component) and [`hash helper`](https://www.emberjs.com/api/ember/release/classes/Ember.Templates.helpers/methods/hash?anchor=hash).
Here, the appropriate component is assigned to a hash using nested helpers and yielded to the template.
Notice `editStyle` being used as an argument to the component helper.

Expand Down
4 changes: 2 additions & 2 deletions source/configuring-ember/disabling-prototype-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ objects in the following ways:

* `String` is extended to add convenience methods, such as
`camelize()` and `w()`. You can find a list of these methods with the
[Ember.String documentation](https://www.emberjs.com/api/ember/2.16/classes/String).
[Ember.String documentation](https://www.emberjs.com/api/ember/release/classes/String).

* `Function` is extended with methods to annotate functions as
computed properties, via the `property()` method, and as observers,
Expand Down Expand Up @@ -90,7 +90,7 @@ islands.includes('Oahu');
### Strings

Strings will no longer have the convenience methods described in the
[`Ember.String` API reference](https://www.emberjs.com/api/ember/2.16/classes/String).
[`Ember.String` API reference](https://www.emberjs.com/api/ember/release/classes/String).
Instead,
you can use the similarly-named methods of the `Ember.String` object and
pass the string to use as the first parameter:
Expand Down
2 changes: 1 addition & 1 deletion source/models/customizing-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default DS.JSONAPIAdapter.extend({
In some cases, your dynamic headers may require data from some
object outside of Ember's observer system (for example
`document.cookie`). You can use the
[volatile](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject%2Fcomputed/methods/property?anchor=volatile&show=inherited%2Cprotected%2Cprivate%2Cdeprecated)
[volatile](https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject%2Fcomputed/methods/property?anchor=volatile&show=inherited%2Cprotected%2Cprivate%2Cdeprecated)
function to set the property into a non-cached mode causing the headers to
be recomputed with every request.

Expand Down
4 changes: 2 additions & 2 deletions source/object-model/bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bindings in Ember.js can be used with any object. That said, bindings are most
often used within the Ember framework itself, and for most problems Ember app
developers face, computed properties are the appropriate solution.

The easiest way to create a two-way binding is to use a [`computed.alias()`](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject%2Fcomputed/methods/alias?anchor=alias&show=inherited%2Cprotected%2Cprivate%2Cdeprecated),
The easiest way to create a two-way binding is to use a [`computed.alias()`](https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject%2Fcomputed/methods/alias?anchor=alias&show=inherited%2Cprotected%2Cprivate%2Cdeprecated),
that specifies the path to another object.

```javascript
Expand Down Expand Up @@ -37,7 +37,7 @@ overhead of syncing bindings when values are transient.
## One-Way Bindings

A one-way binding only propagates changes in one direction, using
[`computed.oneWay()`](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject%2Fcomputed/methods/alias?anchor=oneWay&show=inherited%2Cprotected%2Cprivate%2Cdeprecated). Often, one-way bindings are a performance
[`computed.oneWay()`](https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject%2Fcomputed/methods/alias?anchor=oneWay&show=inherited%2Cprotected%2Cprivate%2Cdeprecated). Often, one-way bindings are a performance
optimization and you can safely use a two-way binding (which are de facto one-way bindings if you only ever change one side).
Sometimes one-way bindings are useful to achieve specific behaviour such as a
default that is the same as another property but can be overridden (e.g. a
Expand Down
14 changes: 7 additions & 7 deletions source/object-model/classes-and-instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ as other major features of the Ember object model.
To define a new Ember _class_, call the [`extend()`][1] method on
[`EmberObject`][2]:

[1]: https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject/methods/extend?anchor=extend
[2]: https://www.emberjs.com/api/ember/2.16/modules/@ember%2Fobject
[1]: https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject/methods/extend?anchor=extend
[2]: https://www.emberjs.com/api/ember/release/modules/@ember%2Fobject

```javascript
import EmberObject from '@ember/object';
Expand All @@ -26,7 +26,7 @@ You can also create a _subclass_ from any existing class by calling
its `extend()` method. For example, you might want to create a subclass
of Ember's built-in [`Component`][3] class:

[3]: https://www.emberjs.com/api/ember/2.16/classes/Component
[3]: https://www.emberjs.com/api/ember/release/classes/Component

```app/components/todo-item.js
import Component from '@ember/component';
Expand Down Expand Up @@ -93,7 +93,7 @@ class by calling its [`create()`][5] method. Any methods, properties and
computed properties you defined on the class will be available to
instances:

[5]: https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject/methods/create?anchor=create
[5]: https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject/methods/create?anchor=create

```javascript
import EmberObject from '@ember/object';
Expand Down Expand Up @@ -145,7 +145,7 @@ When a new instance is created, its [`init()`][6] method is invoked
automatically. This is the ideal place to implement setup required on new
instances:

[6]: https://www.emberjs.com/api/ember/2.16/classes/EmberObject/methods/init?anchor=init
[6]: https://www.emberjs.com/api/ember/release/classes/EmberObject/methods/init?anchor=init

```js
import EmberObject from '@ember/object';
Expand Down Expand Up @@ -229,8 +229,8 @@ Person.create({
When accessing the properties of an object, use the [`get()`][7]
and [`set()`][8] accessor methods:

[7]: https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject/methods/get?anchor=get
[8]: https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject/methods/set?anchor=set
[7]: https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject/methods/get?anchor=get
[8]: https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject/methods/set?anchor=set

```js
import EmberObject from '@ember/object';
Expand Down
6 changes: 3 additions & 3 deletions source/object-model/computed-properties-and-aggregate-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ you would declare the dependency with braces: `todos.@each.{priority,title}`
### Computed Property Macros

Ember also provides a computed property macro
[`computed.filterBy`](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject%2Fcomputed/methods/alias?anchor=filterBy&show=inherited%2Cprotected%2Cprivate%2Cdeprecated),
[`computed.filterBy`](https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject%2Fcomputed/methods/alias?anchor=filterBy&show=inherited%2Cprotected%2Cprivate%2Cdeprecated),
which is a shorter way of expressing the above computed property:

```app/components/todo-list.js
Expand Down Expand Up @@ -133,10 +133,10 @@ export default Component.extend({
Here, `indexOfSelectedTodo` depends on `todos.[]`, so it will update if we add an item
to `todos`, but won't update if the value of `isDone` on a `todo` changes.

Several of the [Ember.computed](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject%2Fcomputed) macros
Several of the [Ember.computed](https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject%2Fcomputed) macros
utilize the `[]` key to implement common use-cases. For instance, to
create a computed property that mapped properties from an array, you could use
[Ember.computed.map](https://www.emberjs.com/api/ember/2.16/classes/@ember%2Fobject%2Fcomputed/methods/map?anchor=map)
[Ember.computed.map](https://www.emberjs.com/api/ember/release/classes/@ember%2Fobject%2Fcomputed/methods/map?anchor=map)
or build the computed property yourself:

```javascript
Expand Down
2 changes: 1 addition & 1 deletion source/object-model/computed-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ Person = EmberObject.extend({
```

To see the full list of computed property macros, have a look at
[the API documentation](https://www.emberjs.com/api/ember/2.16/modules/@ember%2Fobject)
[the API documentation](https://www.emberjs.com/api/ember/release/modules/@ember%2Fobject)
Loading

0 comments on commit 7a0aa82

Please sign in to comment.