From de424c1ba659c1f32e26d1667e4e1d36b3381356 Mon Sep 17 00:00:00 2001 From: Daniel Fernau Date: Mon, 22 Jan 2018 01:02:58 +0100 Subject: [PATCH] URLs to missing API docs added #2177 https://github.com/emberjs/guides/pull/2085 --- .../disabling-prototype-extensions.md | 2 +- .../handling-deprecations.md | 2 +- .../creating-updating-and-deleting-records.md | 2 +- source/models/finding-records.md | 2 +- source/object-model/enumerables.md | 24 +++++++++---------- source/object-model/index.md | 2 +- source/object-model/observers.md | 2 +- .../reopening-classes-and-instances.md | 6 ++--- source/templates/writing-helpers.md | 4 ++-- source/testing/acceptance.md | 22 ++++++++--------- source/tutorial/autocomplete-component.md | 4 ++-- source/tutorial/model-hook.md | 2 +- source/tutorial/routes-and-templates.md | 6 ++--- 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/source/configuring-ember/disabling-prototype-extensions.md b/source/configuring-ember/disabling-prototype-extensions.md index 9d8f721f2..fe5a69f85 100644 --- a/source/configuring-ember/disabling-prototype-extensions.md +++ b/source/configuring-ember/disabling-prototype-extensions.md @@ -147,7 +147,7 @@ fullNameDidChange: observer('fullName', function() { }) ``` -Evented functions are annotated using `Ember.on()`: +Evented functions are annotated using [`Ember.on()`](https://emberjs.com/api/ember/2.15/namespaces/Ember/methods/on?anchor=on): ```javascript import { on } from "@ember/object/evented" diff --git a/source/configuring-ember/handling-deprecations.md b/source/configuring-ember/handling-deprecations.md index 93dd1bd0c..6d3706f1f 100644 --- a/source/configuring-ember/handling-deprecations.md +++ b/source/configuring-ember/handling-deprecations.md @@ -10,7 +10,7 @@ Fortunately, Ember provides a way for projects to deal with deprecations in an o ## Filtering Deprecations When your project has a lot of deprecations, you can start by filtering out deprecations that do not have to be addressed right away. You -can use the [deprecation handlers](http://emberjs.com/api/classes/Ember.Debug.html#method_registerDeprecationHandler) API to check for what +can use the [deprecation handlers](https://emberjs.com/api/ember/2.15/classes/Ember.Debug/methods/registerDeprecationHandler?anchor=registerDeprecationHandler) API to check for what release a deprecated feature will be removed. An example handler is shown below that filters out all deprecations that are not going away in release 2.0.0. diff --git a/source/models/creating-updating-and-deleting-records.md b/source/models/creating-updating-and-deleting-records.md index 4baf1c837..ed75ba87f 100644 --- a/source/models/creating-updating-and-deleting-records.md +++ b/source/models/creating-updating-and-deleting-records.md @@ -27,7 +27,7 @@ this.get('store').findRecord('person', 1).then(function(tyrion) { All of the Ember.js conveniences are available for modifying attributes. For example, you can use `Ember.Object`'s -[`incrementProperty`](http://emberjs.com/api/classes/Ember.Object.html#method_incrementProperty) helper: +[`incrementProperty`](https://emberjs.com/api/ember/2.15/classes/Ember.Object/methods/incrementProperty?anchor=incrementProperty) helper: ```js person.incrementProperty('age'); // Happy birthday! diff --git a/source/models/finding-records.md b/source/models/finding-records.md index 96b482a76..18a96e8d2 100644 --- a/source/models/finding-records.md +++ b/source/models/finding-records.md @@ -32,7 +32,7 @@ let blogPosts = this.get('store').peekAll('blog-post'); // => no network request `store.findAll()` returns a `DS.PromiseArray` that fulfills to a `DS.RecordArray` and `store.peekAll` directly returns a `DS.RecordArray`. -It's important to note that `DS.RecordArray` is not a JavaScript array, it's an object that implements [`Ember.Enumerable`](http://emberjs.com/api/classes/Ember.Enumerable.html). +It's important to note that `DS.RecordArray` is not a JavaScript array, it's an object that implements [`Ember.Enumerable`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable). This is important because, for example, if you want to retrieve records by index, the `[]` notation will not work--you'll have to use `objectAt(index)` instead. diff --git a/source/object-model/enumerables.md b/source/object-model/enumerables.md index 8a5f4b185..78fc0ab29 100644 --- a/source/object-model/enumerables.md +++ b/source/object-model/enumerables.md @@ -1,6 +1,6 @@ In Ember.js, an enumerable is any object that contains a number of child objects, and which allows you to work with those children using the -[Ember.Enumerable](http://emberjs.com/api/classes/Ember.Enumerable.html) API. The most common +[Ember.Enumerable](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable) API. The most common enumerable in the majority of apps is the native JavaScript array, which Ember.js extends to conform to the enumerable interface. @@ -46,11 +46,11 @@ in an observable fashion, you should use `myArray.get('firstObject')` and In the rest of this guide, we'll explore some of the most common enumerable conveniences. For the full list, please see the [Ember.Enumerable API -reference documentation.](http://emberjs.com/api/classes/Ember.Enumerable.html) +reference documentation.](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable) ### Iterating Over an Enumerable -To enumerate all the values of an enumerable object, use the [`forEach()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_forEach) +To enumerate all the values of an enumerable object, use the [`forEach()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/forEach?anchor=forEach) method: @@ -68,7 +68,7 @@ food.forEach((item, index) => { ### First and Last Objects -All enumerables expose [`firstObject`](http://emberjs.com/api/classes/Ember.Enumerable.html#property_firstObject) and [`lastObject`](http://emberjs.com/api/classes/Ember.Enumerable.html#property_lastObject) properties +All enumerables expose [`firstObject`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/properties/firstObject?anchor=firstObject) and [`lastObject`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/properties/lastObject?anchor=lastObject) properties that you can bind to. @@ -88,7 +88,7 @@ animals.get('lastObject'); ### Map You can easily transform each item in an enumerable using the -[`map()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_map) method, which creates a new array with results of calling a +[`map()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/map?anchor=map) method, which creates a new array with results of calling a function on each item in the enumerable. @@ -99,7 +99,7 @@ let emphaticWords = words.map(item => `${item}!`); //=> ["goodbye!", "cruel!", "world!"] ``` -If your enumerable is composed of objects, there is a [`mapBy()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_mapBy) +If your enumerable is composed of objects, there is a [`mapBy()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/mapBy?anchor=mapBy) method that will extract the named property from each of those objects in turn and return a new array: @@ -127,7 +127,7 @@ Another common task to perform on an enumerable is to take the enumerable as input, and return an Array after filtering it based on some criteria. -For arbitrary filtering, use the [`filter()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_filter) method. The filter method +For arbitrary filtering, use the [`filter()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/filter?anchor=filter) method. The filter method expects the callback to return `true` if Ember should include it in the final Array, and `false` or `undefined` if Ember should not. @@ -140,7 +140,7 @@ arr.filter((item, index, self) => item < 4); //=> [1, 2, 3] ``` -When working with a collection of Ember objects, you will often want to filter a set of objects based upon the value of some property. The [`filterBy()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_filterBy) method provides a shortcut. +When working with a collection of Ember objects, you will often want to filter a set of objects based upon the value of some property. The [`filterBy()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/filterBy?anchor=filterBy) method provides a shortcut. ```javascript @@ -162,14 +162,14 @@ todos.filterBy('isDone', true); ``` If you only want to return the first matched value, rather than an Array -containing all of the matched values, you can use [`find()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_find) and [`findBy()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_findBy), +containing all of the matched values, you can use [`find()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/find?anchor=find) and [`findBy()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/findBy?anchor=findBy), which work like `filter()` and `filterBy()`, but return only one item. ### Aggregate Information (Every or Any) To find out whether every item in an enumerable matches some condition, you can -use the [`every()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_every) method: +use the [`every()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/every?anchor=every) method: ```javascript @@ -191,7 +191,7 @@ people.every((person, index, self) => person.get('isHappy')); ``` To find out whether at least one item in an enumerable matches some condition, -you can use the [`any()`](http://emberjs.com/api/classes/Ember.Enumerable.html#method_any) method: +you can use the [`any()`](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable/methods/any?anchor=any) method: ```javascript @@ -200,7 +200,7 @@ people.any((person, index, self) => person.get('isHappy')); //=> true ``` -Like the filtering methods, the `every()` and `any()` methods have +Like the filtering methods, the `every()` and `any()` methods have analogous `isEvery()` and `isAny()` methods. ```javascript diff --git a/source/object-model/index.md b/source/object-model/index.md index 029496284..fbf97c500 100644 --- a/source/object-model/index.md +++ b/source/object-model/index.md @@ -12,7 +12,7 @@ JavaScript classes or common patterns, but all are aligned as much as possible with the language and proposed additions. Ember also extends the JavaScript `Array` prototype with its -[Ember.Enumerable](http://emberjs.com/api/classes/Ember.Enumerable.html) interface to provide change observation for arrays. +[Ember.Enumerable](https://emberjs.com/api/ember/2.15/classes/Ember.Enumerable) interface to provide change observation for arrays. Finally, Ember extends the `String` prototype with a few [formatting and localization methods](https://www.emberjs.com/api/ember/release/classes/String). diff --git a/source/object-model/observers.md b/source/object-model/observers.md index ebe430a74..783313388 100644 --- a/source/object-model/observers.md +++ b/source/object-model/observers.md @@ -110,7 +110,7 @@ Observers never fire until after the initialization of an object is complete. If you need an observer to fire as part of the initialization process, you cannot rely on the side effect of `set`. Instead, specify that the observer -should also run after `init` by using [`Ember.on()`](http://emberjs.com/api/classes/Ember.html#method_on): +should also run after `init` by using [`Ember.on()`](https://emberjs.com/api/ember/2.15/namespaces/Ember/methods/on?anchor=on): ```javascript diff --git a/source/object-model/reopening-classes-and-instances.md b/source/object-model/reopening-classes-and-instances.md index d10969f05..e7727b697 100644 --- a/source/object-model/reopening-classes-and-instances.md +++ b/source/object-model/reopening-classes-and-instances.md @@ -1,6 +1,6 @@ You don't need to define a class all at once. You can reopen a class and define new properties using the -[`reopen()`](http://emberjs.com/api/classes/Ember.Object.html#method_reopen) +[`reopen()`](https://emberjs.com/api/ember/2.15/classes/Ember.Object/methods/reopen?anchor=reopen) method. ```javascript @@ -24,12 +24,12 @@ Person.reopen({ }); ``` -`reopen()` is used to add instance methods and properties that are shared +`reopen()` is used to add instance methods and properties that are shared across all instances of a class. It does not add methods and properties to a particular instance of a class as in vanilla JavaScript (without using prototype). But when you need to add static methods or static properties to the class itself -you can use [`reopenClass()`](http://emberjs.com/api/classes/Ember.Object.html#method_reopenClass). +you can use [`reopenClass()`](https://emberjs.com/api/ember/2.15/classes/Ember.Object/methods/reopenClass?anchor=reopenClass). ```javascript // add static property to class diff --git a/source/templates/writing-helpers.md b/source/templates/writing-helpers.md index 3420a3689..e56ec8361 100644 --- a/source/templates/writing-helpers.md +++ b/source/templates/writing-helpers.md @@ -37,7 +37,7 @@ You can also have Ember generate the file for you from the command line: ember generate helper format-currency ``` -That file should export a function wrapped with [`Ember.Helper.helper()`](http://emberjs.com/api/classes/Ember.Helper.html#method_helper): +That file should export a function wrapped with [`Ember.Helper.helper()`](https://emberjs.com/api/ember/2.15/classes/Ember.Helper/methods/helper?anchor=helper): ```app/helpers/format-currency.js import { helper } from "@ember/component/helper" @@ -396,5 +396,5 @@ type="javascript">alert('pwned!');</script> has joined the channel. ``` [1]: https://www.emberjs.com/api/ember/release/classes/Helper [2]: https://www.emberjs.com/api/ember/release/classes/Helper/methods/compute?anchor=compute -[3]: http://emberjs.com/api/classes/Ember.Helper.html#method_helper +[3]: https://emberjs.com/api/ember/2.15/classes/Ember.Helper/methods/helper?anchor=helper [4]: https://www.emberjs.com/api/ember/release/classes/@ember%2Fstring/methods/htmlSafe?anchor=htmlSafe diff --git a/source/testing/acceptance.md b/source/testing/acceptance.md index 93882baea..afff43d20 100644 --- a/source/testing/acceptance.md +++ b/source/testing/acceptance.md @@ -147,15 +147,15 @@ In the `andThen` helper, we finally make our call to `assert.equal` which makes assertion that the text found in the first li of the ul whose class is "posts" is equal to "My new post". -[1]: http://emberjs.com/api/classes/Ember.Test.html#method_click -[2]: http://emberjs.com/api/classes/Ember.Test.html#method_fillIn -[3]: http://emberjs.com/api/classes/Ember.Test.html#method_keyEvent -[4]: http://emberjs.com/api/classes/Ember.Test.html#method_triggerEvent -[5]: http://emberjs.com/api/classes/Ember.Test.html#method_visit -[6]: http://emberjs.com/api/classes/Ember.Test.html#method_currentPath -[7]: http://emberjs.com/api/classes/Ember.Test.html#method_currentRouteName -[8]: http://emberjs.com/api/classes/Ember.Test.html#method_currentURL -[9]: http://emberjs.com/api/classes/Ember.Test.html#method_find +[1]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/click?anchor=click +[2]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/fillIn?anchor=fillIn +[3]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/keyEvent?anchor=keyEvent +[4]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/triggerEvent?anchor=triggerEvent +[5]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/visit?anchor=visit +[6]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/currentPath?anchor=currentPath +[7]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/currentRouteName?anchor=currentRouteName +[8]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/currentURL?anchor=currentURL +[9]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/find?anchor=find ### Custom Test Helpers @@ -178,8 +178,8 @@ called. The difference between `Ember.Test.registerHelper` and previous async helper has completed and any subsequent async helper will wait for it to finish before running. -[10]: http://emberjs.com/api/classes/Ember.Test.html#method_registerAsyncHelper -[11]: http://emberjs.com/api/classes/Ember.Test.html#method_registerHelper +[10]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/registerAsyncHelper?anchor=registerAsyncHelper +[11]: https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/registerHelper?anchor=registerHelper The helper method will always be called with the current Application as the first parameter. Other parameters, such as assert, need to be provided when calling the helper. Helpers need to be registered prior to calling diff --git a/source/tutorial/autocomplete-component.md b/source/tutorial/autocomplete-component.md index ed66093cf..b3a242b3c 100644 --- a/source/tutorial/autocomplete-component.md +++ b/source/tutorial/autocomplete-component.md @@ -523,8 +523,8 @@ test('should filter the list of rentals by city.', function (assert) { We introduce two new helpers into this test, `fillIn` and `keyEvent`. -* The [`fillIn`](http://emberjs.com/api/classes/Ember.Test.html#method_fillIn) helper "fills in" the given text into an input field matching the given selector. -* The [`keyEvent`](http://emberjs.com/api/classes/Ember.Test.html#method_keyEvent) helper sends a key stroke event to the UI, simulating the user typing a key. +* The [`fillIn`](https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/fillIn?anchor=fillIn) helper "fills in" the given text into an input field matching the given selector. +* The [`keyEvent`](https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/keyEvent?anchor=keyEvent) helper sends a key stroke event to the UI, simulating the user typing a key. In `app/components/list-filter.js`, we have as the top-level element rendered by the component a class called `list-filter`. We locate the search input within the component using the selector `.list-filter input`, diff --git a/source/tutorial/model-hook.md b/source/tutorial/model-hook.md index 64e5ed3c2..d7ea5a143 100644 --- a/source/tutorial/model-hook.md +++ b/source/tutorial/model-hook.md @@ -108,7 +108,7 @@ To check that rentals are listed with an automated test, we will create a test t In `app/templates/rentals.hbs`, we wrapped each rental display in an `article` element, and gave it a class called `listing`. We will use the listing class to find out how many rentals are shown on the page. -To find the elements that have a class called `listing`, we'll use a test helper called [find](http://emberjs.com/api/classes/Ember.Test.html#method_find). +To find the elements that have a class called `listing`, we'll use a test helper called [find](https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/find?anchor=find). The `find` function returns the elements that match the given [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors). In this case it will return an array of all the elements with a class called `listing`. diff --git a/source/tutorial/routes-and-templates.md b/source/tutorial/routes-and-templates.md index 0cd361a93..0d38c0f4b 100644 --- a/source/tutorial/routes-and-templates.md +++ b/source/tutorial/routes-and-templates.md @@ -323,11 +323,11 @@ such as visiting routes, filling in fields, clicking on links/buttons, and waiti Some of the helpers we'll use commonly are: -* [`visit`](http://emberjs.com/api/classes/Ember.Test.html#method_visit) - loads a given URL -* [`click`](http://emberjs.com/api/classes/Ember.Test.html#method_click) - pretends to be a user clicking on a specific part of the screen +* [`visit`](https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/visit?anchor=visit) - loads a given URL +* [`click`](https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/click?anchor=click) - pretends to be a user clicking on a specific part of the screen * [`andThen`](../../testing/acceptance/#toc_wait-helpers) - waits for our previous commands to run before executing our function. In our test below, we want to wait for our page to load after `click` is called so that we can double-check that the new page has loaded -* [`currentURL`](http://emberjs.com/api/classes/Ember.Test.html#method_currentURL) - returns the URL of the page we're currently on +* [`currentURL`](https://emberjs.com/api/ember/2.15/classes/Ember.Test/methods/currentURL?anchor=currentURL) - returns the URL of the page we're currently on ### Test visiting our About and Contact pages Now let's add code that simulates a visitor arriving on our homepage, clicking one of our links and then visiting a new page.