I have this code:
<div ng-init="users = [ <?foreach($users as $user):?> {id:'<?= $user['id'] ?>', name:'<?= $user['name'] ?>', phone:'<?= $user['phone'] ?>', country_id:'<?= $user['country_id'] ?>'}, <?endforeach;?> ]"></div> <div class="row" ng-controller="AngularCtrl" ng-repeat="user in users"> Here I do something with user. And then I need to use the list of countries and compare user.country_id with $ country ['id'].
<select class="form-control" name="country" onchange="setCountry(user.id, this.value)" ng-disabled="!country"> <?foreach ($countries as $country):?> <option value="<?= $country['id'] ?>" <?if ($user['country_id'] == $country['id']) echo "selected"?>><?= $country['country'] ?></option> <?endforeach;?> </select> </div> How can I do that? Or how to rewrite the code accordingly?