diff --git a/src/ng/directive/ngOptions.js b/src/ng/directive/ngOptions.js index e07aa137f2a6..acdb9648f51a 100644 --- a/src/ng/directive/ngOptions.js +++ b/src/ng/directive/ngOptions.js @@ -395,14 +395,11 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { return { restrict: 'A', terminal: true, - require: ['select', '?ngModel'], + require: ['select', 'ngModel'], link: function(scope, selectElement, attr, ctrls) { - // if ngModel is not defined, we don't need to do anything - var ngModelCtrl = ctrls[1]; - if (!ngModelCtrl) return; - var selectCtrl = ctrls[0]; + var ngModelCtrl = ctrls[1]; var multiple = attr.multiple; // The emptyOption allows the application developer to provide their own custom "empty" diff --git a/test/ng/directive/ngOptionsSpec.js b/test/ng/directive/ngOptionsSpec.js index 40cb245253d5..f66a56df034c 100644 --- a/test/ng/directive/ngOptionsSpec.js +++ b/test/ng/directive/ngOptionsSpec.js @@ -156,10 +156,10 @@ describe('ngOptions', function() { }); - it('should have optional dependency on ngModel', function() { + it('should have a dependency on ngModel', function() { expect(function() { compile(''); - }).not.toThrow(); + }).toThrow(); });