diff options
| author | Igor Minar | 2013-05-24 11:00:14 -0700 | 
|---|---|---|
| committer | Vojta Jina | 2013-05-24 17:03:21 -0700 | 
| commit | b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5 (patch) | |
| tree | f3b34e25e27d088bec9b698b246d49f86281de36 /src/ng/controller.js | |
| parent | 88eaea8e7bf025a7805a5d20f5d47472e4f26f6f (diff) | |
| download | angular.js-b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5.tar.bz2 | |
feat(ngError): add error message compression and better error messages
- add toThrowNg matcher
Diffstat (limited to 'src/ng/controller.js')
| -rw-r--r-- | src/ng/controller.js | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/src/ng/controller.js b/src/ng/controller.js index 5c19cf88..2df0bde9 100644 --- a/src/ng/controller.js +++ b/src/ng/controller.js @@ -74,9 +74,8 @@ function $ControllerProvider() {        instance = $injector.instantiate(expression, locals);        if (identifier) { -        if (typeof locals.$scope !== 'object') { -          throw new Error('Can not export controller as "' + identifier + '". ' + -              'No scope object provided!'); +        if (!(locals && typeof locals.$scope == 'object')) { +          throw ngError(47, "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", constructor || expression.name, identifier);          }          locals.$scope[identifier] = instance; | 
