Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding load asyncData with ngHierarchicalSelector #18

Open
ynotsarath opened this issue Aug 2, 2016 · 0 comments
Open

Regarding load asyncData with ngHierarchicalSelector #18

ynotsarath opened this issue Aug 2, 2016 · 0 comments

Comments

@ynotsarath
Copy link

i am facing some problems with asyncData as hierarchical selector is populating with no data.

[{"id":987,"name":"AP","children":[]},{"id":978,"name":"MP","children":[]},{"id":992,"name":"UP","children":[]},{"id":997,"name":"HP","children":[]},{"id":1007,"name":"AAP","children":[]}]

I am using the same example with different data as below:
we have some services to get for cities in each and every object of above array

html:

jS:

$scope.loadAsyncData = function(parent) {
var defer = $q.defer();
if (!parent) {
$http.get("api/.....myservicecall").success(function (data) {
data = data.List;
for (var i = 0; i < data.length; i++) {
data[i].hasChildren = true;
}
defer.resolve(data);
});
}else{
$http.get("api/....myservicecall?id="+parent.id).success(function (data) {
data = data.List;
for (var i = 0; i < data.length -1; i++) {
data[i].hasChildren = true;
}
defer.resolve(data);
}).error(function (data){

                                });                             
                            }

i totally understand with assigning data="data". but i am not able to understand how it will load with async data..

Please help me out on this .. or any where i can get document regarding asyncdata loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant