aboutsummaryrefslogtreecommitdiffstats
path: root/src/service/formFactory.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/formFactory.js')
-rw-r--r--src/service/formFactory.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/service/formFactory.js b/src/service/formFactory.js
index c9cb9c53..972b46ee 100644
--- a/src/service/formFactory.js
+++ b/src/service/formFactory.js
@@ -98,8 +98,9 @@
*/
function $FormFactoryProvider() {
- this.$get = ['$rootScope', function($rootScope) {
-
+ var $parse;
+ this.$get = ['$rootScope', '$parse', function($rootScope, $parse_) {
+ $parse = $parse_;
/**
* @ngdoc proprety
* @name rootForm
@@ -352,10 +353,14 @@ function $FormFactoryProvider() {
modelScope = params.scope,
onChange = params.onChange,
alias = params.alias,
- scopeGet = parser(params.model).assignable(),
+ scopeGet = $parse(params.model),
scopeSet = scopeGet.assign,
widget = this.$new(params.controller, params.controllerArgs);
+ if (!scopeSet) {
+ throw Error("Expression '" + params.model + "' is not assignable!");
+ };
+
widget.$error = {};
// Set the state to something we know will change to get the process going.
widget.$modelValue = Number.NaN;