Why the line
var scope = $rootScope.$new();
dump($compile('<ul><li ng-repeat="item in [1,3,5,7,9]">{{item}}</li></ul>')(scope));
results in:
'<ul class="ng-scope"><!-- ngRepeat: item in [1,3,5,7,9] --></ul>'
I would like to see <li>
items rather than comment.
you're missing the digest
method to go all the way
var e = $compile('<div><ul><li ng-repeat="item in [1,3,5,7,9]">{{item}}</li></ul></div>')(scope);
scope.$digest();
console.log(e.html());
This is the output I get now:
Safari 537.21 (Linux) LOG: '
<ul><!-- ngRepeat: item in [1,3,5,7,9] -->
<li ng-repeat="item in [1,3,5,7,9]" class="ng-scope ng-binding">1</li>
<li ng-repeat="item in [1,3,5,7,9]" class="ng-scope ng-binding">3</li>
<li ng-repeat="item in [1,3,5,7,9]" class="ng-scope ng-binding">5</li>
<li ng-repeat="item in [1,3,5,7,9]" class="ng-scope ng-binding">7</li>
<li ng-repeat="item in [1,3,5,7,9]" class="ng-scope ng-binding">9</li>
</ul>'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With