Angular directive recursive rendering

试图用Angular directive去绚烂页面层次结构,于是在一个directive的模板页面中使用<directive></directive>的形式去写,页面立马崩溃。

After searching, it was found that it was a problem with this way of writing, and writing in this way would enter an infinite loop.
The last way to write:
Create a new directive,
element.html(template);
$compile(element.contents())(scope);
In this way, add the elements that need to be recursive, so OK

Guess you like

Origin blog.csdn.net/yujiayinshi/article/details/49892167