Skip to content Skip to sidebar Skip to footer

How Can I Find The Page Where Ill Do The Changes In Angular.js?

It is a completed project, I am asked to solve an issue. There are 3 select boxes, and all have different names. First select box's name is nameSelectBox162572640796915, second one

Solution 1:

Here's one way to do it. Set the options to be created through ng-repeat, then use ng-disabled to test for which numbers have been selected already

angular.module('myApp', [
  // myApp dependencies (controllers, etc.) injected here...'myApp.controllers'
]);

angular.module('myApp.controllers', []).
controller('MyCtrl', ['$scope', function($scope) {
  $scope.select1 = '';
  $scope.select2 = '';
  $scope.select3 = '';
  $scope.numbers = [1, 2, 3, 4, 5];

}])
<htmlng-app="myApp"ng-controller="MyCtrl"><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script><selectng-model="select1"><optionng-repeat='num in numbers'ng-disabled="(select2 == num || select3 == num)">{{num}}</option></select><selectng-model="select2"><optionng-repeat='num in numbers'ng-disabled="(select1 == num || select3 == num)">{{num}}</option></select><selectng-model="select3"><optionng-repeat='num in numbers'ng-disabled="(select2 == num || select1 == num)">{{num}}</option></select></html>

Post a Comment for "How Can I Find The Page Where Ill Do The Changes In Angular.js?"