Just starting out with angularjs and trying to unravel the mystery here.
Using ng-repeat:
<li class="widget flip-container" ng-repeat="widget in widgets">
<div class="widgetContent" ng-bind-html="getData(widget.UserWidgetId,widget.Url)">
</div>
</li>
The getData function looks like this:
$scope.getData = function(id, url) {
if (url == null || url == "") return "";
return userWidgetsFactory.getWidgetHtml(url).success(function(results) {
return results;
});
};
Here's the factory code:
app.factory("userWidgetsFactory", function($http) {
var factory = {};
factory.getWidgetHtml = function(url) {
return $http.get(url);
};
return factory;
});
I'm encountering an issue where the function keeps getting called repeatedly and doesn't stop. I have a feeling I'm way off base here.