A jQuery ajax request loads the HTML of an angular app (out of multiple independent angular apps) and injects it in the DOM (simplified code):
$.ajax({
'url': 'url-to-random-angular-app.html',
'success': function(data) {
var content = $(data).find('[data-id]');
//var content = '<div data-id="5"><div ng-app="MyRandomApp" ng-controller="MyRandomAppController">[...]</div></div>';
//angular.???.$compile(content);
$('#container').html(content);
}
});
My problem is, that the angular app is not working, because it's not initialized somewhere. How can I init the angular app in the jQuery success callback?