javascript - AngularJS Jade 模板中的空白

标签 javascript angularjs pug

我有以下问题:

p
  directive(attr="foo")
  | (
  directive(attr="bar")
  |)

期望的输出是:

<directive attr="foo"></directive> (<directive attr="bar"></directive>)

但是 Jade 的处理方式是在第一个括号后面引入空格,例如:

<directive attr="foo"></directive> (  <directive attr="bar"></directive>)

有没有办法忽略第一个括号后面的空格?或者我应该用 Angular 找到解决方法吗?

最佳答案

你可以做到

p
    | <directive attr="bar">(</directive><directive attr="bar">)</directive>

关于javascript - AngularJS Jade 模板中的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27831381/

相关文章:

angularjs - CreateProcess 错误=193,%1 不是有效的 Win32 应用程序 -> [帮助 1]

javascript - 如何让 Jade 的外部 JSON 从 Express 渲染?

node.js - 在 Node.js 上使用holder.js 和 Express Web 框架确实有效

javascript - 导入的成员无法创建 Mongoose 模型

javascript - Cufon渲染换行符

javascript - 为什么我的指令不显示我传递给它的字符串

angularjs - 自定义 Angularjs 指令与 ng-class

javascript - AngularJS:在隔离范围内获取属性定义指令的值

javascript - 运行一些 Ajax 代码在控制台中给出了未定义的值

Javascript if 语句错误与 ('&&' )