iVantage / angular-ivh-treeview

A treeview for AngularJS with filtering and checkbox support.
http://ivantage.github.io/angular-ivh-treeview/
MIT License
238 stars 89 forks source link

Remote data bindig #204

Closed madhav24 closed 7 years ago

madhav24 commented 7 years ago

var myApp = angular.module('myAppModule', ['ivh.treeview']); var stuff; myApp.config(function (ivhTreeviewOptionsProvider) { ivhTreeviewOptionsProvider.set({ defaultSelectedState: false, validate: true }); }); myApp.factory('myAppModuleMenu', function ($http) { return $http.get('../../../api/AdminMenu/GetMenu/?type=""', { cache: true }); });

myApp.controller('DemoCtrl', function (mymenu,myAppModuleMenu) { myAppModuleMenu.then(function (response) { this.stuff=response.data; });
});

remote service is returning data but data is not binding in ui. could you please help me?

jtrussell commented 7 years ago

Hi, it would be really helpful if you could use jsbin or codepen to demonstrate your issue.

What's the value of this when you say this.stuff = response.data?

madhav24 commented 7 years ago

below is the code i used for reference. http://jsbin.com/zitiri/edit?html,output

http://jsbin.com/vociroyigi/edit?html,js,output

if i give data as constant it is working fine. check above js bin

but if i make a remote call as in below JSBIN it is not working

http://jsbin.com/tumuxedozo/1/edit?html,js,output

madhav24 commented 7 years ago

i resolved it. check this

http://jsbin.com/tegefeyiwa/edit?html,js,output

Thank you.