After successfully implementing live searching with ng-change, I encountered an issue with a pre-selected drop-down box.
Despite setting the selected="selected" attribute to make option three the default selection, the drop-down box jumps to the top option when the page loads. I need it to stay on option three.
<html>
<body >
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js" type="text/javascript"></script>
<script type="text/javascript">
angular.module('myApp', [])
.controller('Ctrl', function ($scope, $http)
{
});
</script>
<form name="aspnetForm" method="post" action="./Test2.aspx" id="aspnetForm">
<div ng-app="myApp" ng-controller="Ctrl">
<select name="DropDownTest" id="DropDownTest" ng-model="LiveSearchOptions" ng-change="SearchFieldChanged()">
<option value="">ALL</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3" selected="selected">Three</option>
<option value="4">Four</option>
<option value="5">Five</option>
</select>
</div>
</form>
Removing the module (by deleting the script tags) resolves the issue. Can someone please provide guidance? I am new to this!
Check out the JS Fiddle for experimentation: https://jsfiddle.net/4to3ux4g/14/