aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/controller.js')
-rw-r--r--src/ng/controller.js5
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;