如何使用 Jade 将 ui-view="ui-view" 变为 ui-view in html
How to make ui-view="ui-view" to ui-view in html using Jade
我尝试使用 Jade 模板引擎在 Node JS 中实现 angular ui 路由器。
但是 ui 视图不像在 HTML 中那样显示。
以下是我在 Jade 中的代码:
body(ng-app="mainapp")
h1!= message
div.row
div.col-md-4.col-md-offset-4
a(ui-sref="todo") To Do App
a(ui-sref="chat") Chat Room
div.row
div.col-lg-12(ui-view)
它将 HTML 呈现为
<body ng-app="mainapp">
<h1></h1>
<div class="row">
<div class="col-md-4 col-md-offset-4"><a ui-sref="todo">To Do App</a><a ui-sref="chat">Chat Room </a></div>
</div>
<div class="row">
<div ui-view="ui-view" class="col-lg-12"> </div>
</div>
我想删除 ui-view="ui-view" 到 ui-view
将输出渲染为:
<div ui-view class="col-lg-12"> </div>
如何实现
您可以使用
doctype html
在你的玉锉上。
或者只使用一个空属性(主要适用于 angular,我不知道它是否适用于 ui-view)。
div.col-lg-12(ui-view="")
我尝试使用 Jade 模板引擎在 Node JS 中实现 angular ui 路由器。
但是 ui 视图不像在 HTML 中那样显示。 以下是我在 Jade 中的代码:
body(ng-app="mainapp")
h1!= message
div.row
div.col-md-4.col-md-offset-4
a(ui-sref="todo") To Do App
a(ui-sref="chat") Chat Room
div.row
div.col-lg-12(ui-view)
它将 HTML 呈现为
<body ng-app="mainapp">
<h1></h1>
<div class="row">
<div class="col-md-4 col-md-offset-4"><a ui-sref="todo">To Do App</a><a ui-sref="chat">Chat Room </a></div>
</div>
<div class="row">
<div ui-view="ui-view" class="col-lg-12"> </div>
</div>
我想删除 ui-view="ui-view" 到 ui-view 将输出渲染为:
<div ui-view class="col-lg-12"> </div>
如何实现
您可以使用
doctype html
在你的玉锉上。
或者只使用一个空属性(主要适用于 angular,我不知道它是否适用于 ui-view)。
div.col-lg-12(ui-view="")