How can I disable an 'option' element in HTML5 using AngularJS?
Currently, I am working with AngularJS v1.2.25.
Here is the Plunk Link for reference: https://plnkr.co/edit/fS1uKZ
<!-- CODE BEGIN -->
<!DOCTYPE html>
<html>
<head>
<script data-require="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d9b8b7beacb5b8abf7b3aa99ebf7e9f7e9">[email protected]</a>" data-semver="2.0.0" src="https://code.angularjs.org/2.0.0-beta.6/angular2.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
<!-- More select elements here -->
</body>
</html>
<!-- CODE END -->
I'm building a 'form' with multiple 'select' elements containing 'option' tags.
All 'option' tags share the same attributes across these 'select' elements.
The goal is to let users rank car manufacturers by disabling the selected option in all 'select' elements.
I came across a solution using jQuery, but does that align with AngularJS practices? (Disable option in select)
Considering AngularJS has 'jQuery Lite', should I follow this approach or explore other options?
There's documentation on ng-disabled directive at AngularJS site: htt9$://docs.angularjs.org/api/ng/directive/ngDisabled
You can also check out this Plunk example from AngularJS team: htt9$://plnkr.co/edit/?p=preview
I want to avoid modifying core AngularJS files and instead focus on utilizing ng-model and/or ng-disabled without causing technical debt.
Should I separate ng-model and ng-disabled or create a custom filter instead?
Coming from a jQuery background, I aim to adhere to AngularJS best practices and minimize technical debt accumulation.