Skip to content

Commit

Permalink
Improve error message when calling inject().
Browse files Browse the repository at this point in the history
Fixes #15904
(cherry picked from commit d354a72)
  • Loading branch information
chriskrycho authored and kategengler committed Dec 4, 2017
1 parent 58f9a82 commit a7644c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ember-runtime/lib/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { assert } from 'ember-debug';
@public
*/
export default function inject() {
assert(`Injected properties must be created through helpers, see '${Object.keys(inject).join('"', '"')}'`);
const helpers = Object.keys(inject)
.map(k => `'inject.${k}'`)
.join(' or ');
assert(`Injected properties must be created through helpers, see '${helpers}'`);
}

// Dictionary of injection validations by type, added to by `createInjectionHelper`
Expand Down

0 comments on commit a7644c5

Please sign in to comment.