Am newbie to angular js please give me the solution.
How to selected Db values selected in select dropdown list like PHP in angular js?
For example Php coding,
$array = array("apple", "orange", "lemon");
<select>
<option value=""></option>
<?php
foreach ($array as $data) {
?>
<option value="<?php echo $data ?>" <?php if ($data == "orange") echo "selected"; ?>><?php echo $data ?></option>
<?php } ?>
So in PHP we selected value means to give echo selected How to do like in angular js?
My Angular Js code:
<select multiple="multiple" id="citizenship3" name="citizenship3" ng-model="attributes.citizenship" class="example-getting-started form-control" required>
<option ng-repeat="clist in citizenshipList" value="{{clist.country}}" ng-selected="{{ attributes.citizenship.Selected == true }}">{{clist.country}}</option>
</select>
Its fetch all value from DB and also fetching stored db value it's working fine but it's not selected value from DB value How to do Selected in angular js like above PHP coding?Am using ng-selected but it's not working?
My Drop down Design.
