AngularJS select doesn't work without ng-model
Using the select
tag within an Angular app generates the ng-select
directive, which is an HTML SELECT
element plus angular data-binding. Looking in the Angular source for this select
directive, here are the first few lines from its link
method:
link: function(scope, element, attr, ctrls) { // if ngModel is not defined, we don't need to do anything if (!ctrls[1]) return; ...
So it is actually built into the framework to abort linking the directive
if ngModel
is not defined, and so no binding takes place.