Access more specific data of an object

1

I made a GET in a table in my database

$scope.corretor = {};

$scope.getData = function (){
    $http.get("http://.php")
    .success(function(data){
        $scope.corretor = data;
        console.log($scope.corretor);
    })
    .error(function(data, status, headers, config){
        console.log(data);
    });
};
$scope.getData();

console.log

Object
AGENCIA: ""
BANCO: ""
CELULAR: ""
CEP: ""
CIDADE: ""
COMPLEMENTO: ""
CONTA: ""
CPF: 
DTNASCIMENTO: ""
EMAIL: ""
ENDERECO: ""
ENDERECO_COMERCIAL: ""
ID_CORRETOR: "1"
NOME: "LUIZ FABIO LIMA DE MEDEIROS"
NUMERO_ENDERECO: ""
RG: 
TELEFONE: 
TIPO_CONTA: ""
UF: "PA"

But what I want to do is just get the name, and play inside a ng-options

    
asked by anonymous 12.08.2015 / 07:42

1 answer

4

You are assigning the return.

$scope.corretor = data; for the variable broker, that is, your object is now within that variable, in your controller, you can access the NOME property as follows.

$scope.corretor.NOME

In your html you can access.

{{corretor.NOME}}

    
12.08.2015 / 15:28