diff --git a/src/ng/compile.js b/src/ng/compile.js index 941b449ad359..100081952020 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1906,8 +1906,12 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { break; case '=': - if (optional && !attrs[attrName]) { - return; + if (!attrs[attrName]) { + if (optional) { + return; + } + throw Error('Non-assignable model expression: ' + attrs[attrName] + + ' (directive: ' + newIsolateScopeDirective.name + ')'); } parentGet = $parse(attrs[attrName]); if (parentGet.literal) {