Closed madhav24 closed 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
?
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
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?