I am stuck here. what's wrong with my code? i can't get the value of the variable when I return it.
accountManagers : function( id ) {
var accountManager;
$http.get( URL + 'server/agents_account_managers.php?id=' + id ).success( function ( data ) {
if ( data != 0 ) {
accountManager = data[0].first_name + ' ' + data[0].last_name ;
}
});
return accountManager;
}
thanks