diff --git a/src/ng/compile.js b/src/ng/compile.js index b882b826388e..81aca9da7b78 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1073,7 +1073,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { listeners.push(fn); $rootScope.$evalAsync(function() { - if (!listeners.$$inter) { + if (!listeners.$$inter && attrs.hasOwnProperty(key)) { // no one registered attribute interpolation function, so lets call it manually fn(attrs[key]); } diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 0366aa786aaa..0d425d5367bd 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -1331,6 +1331,11 @@ describe('input', function() { expect(scope.name).toEqual('adam'); }); + it('should not add the property to the scope if name is undefined', function() { + compileInput(''); + expect(scope.form['undefined']).toBeUndefined(); + }); + describe('compositionevents', function() { it('should not update the model between "compositionstart" and "compositionend" on non android', inject(function($sniffer) { $sniffer.android = false;