我正在学习 AngularJS,其中一项作业是这样的:
Now, add a new
div
tag to ourindex.html
with an attribute directive that will include the rendered template for the current route.
也就是说,我需要在下面的 div
中放入一些内容,这将渲染正确的(根据路由)模板。
<div class="main-wrapper">
</div>
在我能找到的所有示例中,此任务是通过输入 <ng-view/>
来解决的到 HTML 代码中。
但是这个答案是错误的。
我还能如何实现它(渲染与当前路由相对应的模板)?
最佳答案
关于javascript - 我可以在 ngView 中使用哪些属性来显示当前路由的模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31365946/