Skip to content

Commit

Permalink
URLs to the API docs updated emberjs#2177
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfernau committed Jan 21, 2018
1 parent 181ebb2 commit af16990
Show file tree
Hide file tree
Showing 48 changed files with 147 additions and 147 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
8 changes: 4 additions & 4 deletions source/components/defining-a-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default Route.extend({
});
```

Each component is backed by an element under the hood. By default,
Each component is backed by an element under the hood. By default,
Ember will use a `<div>` element to contain your component's template.
To learn how to change the element Ember uses for your component, see
[Customizing a Component's
Expand All @@ -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 @@ -128,7 +128,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
18 changes: 9 additions & 9 deletions source/models/creating-updating-and-deleting-records.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Creating Records

You can create records by calling the
[`createRecord()`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Store/methods/createRecord?anchor=createRecord)
[`createRecord()`](https://www.emberjs.com/api/ember-data/release/classes/DS.Store/methods/createRecord?anchor=createRecord)
method on the store.

```js
Expand Down Expand Up @@ -36,7 +36,7 @@ person.incrementProperty('age'); // Happy birthday!
## Persisting Records

Records in Ember Data are persisted on a per-instance basis.
Call [`save()`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Model/methods/save?anchor=save)
Call [`save()`](https://www.emberjs.com/api/ember-data/release/classes/DS.Model/methods/save?anchor=save)
on any instance of `DS.Model` and it will make a network request.

Ember Data takes care of tracking the state of each record for
Expand Down Expand Up @@ -68,10 +68,10 @@ store.findRecord('post', 1).then(function(post) {

You can tell if a record has outstanding changes that have not yet been
saved by checking its
[`hasDirtyAttributes`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Model/properties/hasDirtyAttributes?anchor=hasDirtyAttributes)
[`hasDirtyAttributes`](https://www.emberjs.com/api/ember-data/release/classes/DS.Model/properties/hasDirtyAttributes?anchor=hasDirtyAttributes)
property. You can also see what parts of
the record were changed and what the original value was using the
[`changedAttributes()`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Model/methods/changedAttributes?anchor=changedAttributes)
[`changedAttributes()`](https://www.emberjs.com/api/ember-data/release/classes/DS.Model/methods/changedAttributes?anchor=changedAttributes)
method. `changedAttributes` returns an object, whose keys are the changed
properties and values are an array of values `[oldValue, newValue]`.

Expand All @@ -85,7 +85,7 @@ person.changedAttributes(); //=> { isAdmin: [false, true] }

At this point, you can either persist your changes via `save()` or you can roll
back your changes. Calling
[`rollbackAttributes()`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Model/methods/rollbackAttributes?anchor=rollbackAttributes)
[`rollbackAttributes()`](https://www.emberjs.com/api/ember-data/release/classes/DS.Model/methods/rollbackAttributes?anchor=rollbackAttributes)
for a saved record reverts all the `changedAttributes` to their original value.
If the record `isNew` it will be removed from the store.

Expand Down Expand Up @@ -117,7 +117,7 @@ the errors from saving a blog post in your template:

## Promises

[`save()`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Model/methods/save?anchor=save) returns
[`save()`](https://www.emberjs.com/api/ember-data/release/classes/DS.Model/methods/save?anchor=save) returns
a promise, which makes it easy to asynchronously handle success and failure
scenarios. Here's a common pattern:

Expand Down Expand Up @@ -145,10 +145,10 @@ post.save().then(transitionToPost).catch(failure);

## Deleting Records

Deleting records is as straightforward as creating records. Call [`deleteRecord()`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Model/methods/deleteRecord?anchor=deleteRecord)
Deleting records is as straightforward as creating records. Call [`deleteRecord()`](https://www.emberjs.com/api/ember-data/release/classes/DS.Model/methods/deleteRecord?anchor=deleteRecord)
on any instance of `DS.Model`. This flags the record as `isDeleted`. The
deletion can then be persisted using `save()`. Alternatively, you can use
the [`destroyRecord`](https://www.emberjs.com/api/ember-data/2.16/classes/DS.Model/methods/deleteRecord?anchor=destroyRecord) method to delete and persist at the same time.
the [`destroyRecord`](https://www.emberjs.com/api/ember-data/release/classes/DS.Model/methods/deleteRecord?anchor=destroyRecord) method to delete and persist at the same time.

```js
store.findRecord('post', 1, { backgroundReload: false }).then(function(post) {
Expand All @@ -165,4 +165,4 @@ store.findRecord('post', 2, { backgroundReload: false }).then(function(post) {

The `backgroundReload` option is used to prevent the fetching of the destroyed record, since [`findRecord()`][findRecord] automatically schedules a fetch of the record from the adapter.

[findRecord]: <https://www.emberjs.com/api/ember-data/2.16/classes/DS.Store/methods/findRecord?anchor=findRecord>
[findRecord]: <https://www.emberjs.com/api/ember-data/release/classes/DS.Store/methods/findRecord?anchor=findRecord>
Loading

0 comments on commit af16990

Please sign in to comment.