index.jade中的缩进错误

时间:2014-09-11 07:31:52

标签: node.js angularjs

我正在使用angular.js,我使用了民意调查代码。 下面是index.jade的代码:

doctype html
 html(lang='en')
 head 
 meta(charset='utf-8')
  meta(name='viewport', content='width=device-width, initial-scale=1, user-scalable=no') 
  title= title 
  link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.0.1/ css/bootstrap.min.css') 
  link(rel='stylesheet', href='/stylesheets/style.css')
  script(src='//ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js') 
  script(src='//ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular-resource.min.js')
   body 
   nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation')
    div.navbar-header
     a.navbar-brand(href='#/polls')= title
      div.container 
      div

运行代码时出现错误:

2
1 | doctype html
> 2 | html(lang ='en')
3 |头
4 | meta(charset ='utf-8')
5 | meta(name ='viewport',content ='width = device-width,initial-scale = 1,user-scalable = no')

意外的令牌“缩进”

1| doctype html
> 2| html(lang='en')
3| head
4| meta(charset='utf-8')
5| meta(name='viewport', content='width=device-width, initial-scale=1, user-scalable=no')
unexpected token "indent"

1 个答案:

答案 0 :(得分:1)

html(...)不应缩进(与doctype相同的级别):

doctype html
html(lang='en')
  head