Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4d350de

Browse files
wesleychoNarretz
authored andcommitted
docs($q): add note about optional arguments for promise.then()
- Add note about optional arguments in the promise.then api Closes #8562 PR (#14754)
1 parent 116e1d7 commit 4d350de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ng/q.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
*
136136
* **Methods**
137137
*
138-
* - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or
138+
* - `then(successCallback, [errorCallback], [notifyCallback])` – regardless of when the promise was or
139139
* will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously
140140
* as soon as the result is available. The callbacks are called with a single argument: the result
141141
* or rejection reason. Additionally, the notify callback may be called zero or more times to
@@ -146,7 +146,8 @@
146146
* with the value which is resolved in that promise using
147147
* [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).
148148
* It also notifies via the return value of the `notifyCallback` method. The promise cannot be
149-
* resolved or rejected from the notifyCallback method.
149+
* resolved or rejected from the notifyCallback method. The errorCallback and notifyCallback
150+
* arguments are optional.
150151
*
151152
* - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`
152153
*

0 commit comments

Comments
 (0)