angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.81k stars 27.5k forks source link

Angularjs and ldapjs #15909

Closed zeinebu closed 7 years ago

zeinebu commented 7 years ago

Hi Please help me, I am new on developing nodejs. I use ldapjs in an electron angularjs application, I have to get the users of the AD to view, edit and delete it.

`var users =[]; angular.module("app").factory("clientsFactory", function () {

var getUsers = function() { client.search(base_dn, optsUsers, function (err, result) { assert.ifError(err);

    result.on('searchEntry', function(entry) {
        users.push({
            'sAMAccountName': entry.object.sAMAccountName,
            'dn': entry.object.dn
        });
        // rslt=JSON.stringify(entry.object);
        // users=rslt;
        // console.log(rslt);

    });

} );

console.log(users);
return users;

};

return { getUsers: getUsers

}; });

My problem is that if I retrieve the result in a list to retrieve it, it does not give me a normal list but an object contains the objects Then user.dn is empty Below a screenshot of the users object display in the console: capture ` capture

gkalpak commented 7 years ago

This sounds like a general support question. Please, use one of the appropriate support channels for these types of questions. GitHub issues are reserved for bug reports and feature requests.

Thx!