I have the following:
app.directive("myDirective", function($compile) {
return {
replace: true,
scope: {},
template: "<div></div>",
link: function(scope, elem) {
scope.list = [1, 2, 3, 4, 5];
$compile("<div my-list></div>")(scope, function(clone) {
// Why the ng-repeat isn't compiled yet?
alert(clone[0].outerHTML);
elem.html(clone);
});
}
};
});
app.directive("myList", function() {
return {
replace: true,
template: "<ul><li ng-repeat=\"item in list\">{{item}}</li></ul>"
};
});
<div my-directive></div>
Can someone tell me why my <li>'s
are not at my alert
?