这是我的代码:
extends layout
block content
h1= title
p User Directory
// Wrapper
#wrapper
input(type='text', placeholder='Search Users...')
h2 User List
// USER LIST
div(ng-controller='UserListCtrl')
#UserList
table
thead
th UserName
th DOB
tbody
tr(ng-repeat='user in users')
td: a(ng-href='/users/{{user.id}}')= {{user.fc}}
td {{user.birthYear}}
// /USER LIST
// /WRAPPER
带有 anchor 标记的行返回“Unexpected token {”错误。我尝试过很多变体;仅使用 href、连接字符串等。我实际上才刚刚开始学习这一点,所以如果我犯了一个简单的错误,请原谅我的任何无知。
最佳答案
你试过这个吗?
td: a(ng-href='/users/'+{{user.id}})= {{user.fc}}
关于javascript - Angular/JADE - 当我尝试在 ng-href 属性中使用 Angular 标签时,为什么会收到错误 "Unexpected token {"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35871730/