I am using Jquery widget inside a AngularJS directive.
App.directive('eff',['$http',function($http) {
function link(scope, element, attrs) {
$('#Widget').charts(
getWidget(),
function (chart) {
// generate chart widget...
}
});
}
return {
restrict: 'E',
link: link
};
}]);
// Normal JS function
function getWidget(){
// return widget data
}
Now I want to use the $http service form AngularJS inside getWidget function to load data from server.
Is it possible to pass the $http service object to getWidget method and load data?
inject.