Hi,
I have this code inside my directive "list-directive":
return function(scope){
var html_markup = '<ul><li ng-repeat="item in items"><ng-include src="item.contentUrl"></ng-include></li></ul>';
elm.html($compile(html_markup)(scope);
}
in my controller I have:
$scope.items = [
{contentUrl: "myDomain.com"},
{contentUrl: "myDomain.co"},
];
in my partial I have:
<ul list-directive>
Sometimes I see my list after the page loads.
Sometimes when the page loads, I get:[[object HTMLUlistElement]] and in my console, $compile(html_markup)(scope) returns an empty jquery object when this happens.
Any idea why this happens and how to solve it?