mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-21 10:05:34 +08:00
18 lines
381 B
Plaintext
18 lines
381 B
Plaintext
@ngdoc error
|
|
@name $q:norslvr
|
|
@fullName No resolver function passed to $Q
|
|
@description
|
|
|
|
Occurs when calling creating a promise using {@link $q} as a constructor, without providing the
|
|
required `resolver` function.
|
|
|
|
```
|
|
//bad
|
|
var promise = $q().then(doSomething);
|
|
|
|
//good
|
|
var promise = $q(function(resolve, reject) {
|
|
waitForSomethingAsync.then(resolve);
|
|
}).then(doSomething);
|
|
```
|