Autofill html select AngularJS

Viewed 266

I have a little issue with a HTML select with AngularJS. When I do a petition to my API I get one of the values as an integer, but when I try to autofill a select with it I can't set de "value" correctly.

In this picture you can se what the HTML is receiving and the values that I want to set

Example of code

Are there any way to cast this value?

Thanks in advance :)

EDITED:

The controller to get customer data and fill the form

.controller('CustomerDetailCtrl', ['Customer', '$scope', '$sessionStorage', '$stateParams', '$ionicPopup', function (Customer, $scope, $sessionStorage, $stateParams, $ionicPopup) {
    if ($sessionStorage.auth) {
        Customer.get({data: $stateParams.customerId + '_' + $sessionStorage.user_id}).$promise.then(function (data) {
            if (data.response && $sessionStorage.role === 1) {
                $scope.customer = data.response[0];

                if (data.history) {
                    $scope.histories = data.history;
                }
            } else {
                console.log('Error de accesso...');
            }
        })
    }

    $scope.addTask = function (customer) {
        alert('add task!');
    }

    $scope.deleteTask = function (customer, history) {
        alert('delete task!');
    }
}])

The form:

<label class="item item-input item-select">
    <div class="input-label">
        Cliente avisado?
    </div>
    <select name="informed" ng-model="customer.informed" required>
        <option value="0">NO</option>
        <option value="1">SI</option>
    </select>
 </label>

And here a picture of the data from de API: enter image description here

2 Answers
Related