我正在使用Jade构建一个普通的堆栈应用程序,但是我无法让我的任何脚本标记链接工作。链接标签可以正常工作。我尝试过绝对链接和相对链接,以及其他5种问题解决方案(大多数都是几年前发布的),但没有一种解决方案有效。
下面是我的项目中的相关代码:
(header.jade)
link(href='libraries/normalize-css/normalize.css', rel='stylesheet')
link(href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css', rel='stylesheet')
link(href='custom.css', rel='stylesheet')
script(src='https://code.angularjs.org/1.4.7/angular.min.js')
script(src='/js/app.js')(一个我想使用角的例子)
extends userBase
block vars
- var title = 'Login'
block body
h1.love love love
div(ng-controller='ChoiceCtrl')
form(method="post", role="form", style="width:90%; margin: 5px auto;", class="form-horizontal")
input(type='hidden', name='_csrf', value=csrfToken)
div.form-group
label(for="question") Ask your question:
input(type="text", name="question", required=true, class="form-control", id="question", placeholder='Which team will win the super bowl this year...?')
br
ul.list-group
li.list-group-item(ng-repeat="choice in choices")
span {{ 2+2 }}
div.form-group
label(for="responses") Choose Response Options:
.input-group
input(type="text", name="response", class="form-control", id="responses", ng-model='choiceBody')
span.input-group-btn
input(type="submit", class='btn btn-primary', value='Add', ng-click='addChoice()')
input(type="submit", class='btn btn-primary', value='Create Poll')而且,在server.js文件中,静态文件的路由工作正常,所以我不确定问题出在哪里。
剩下的代码在github:https://github.com/gwenf/votenow上
发布于 2015-11-04 18:14:52
我想出来了!我忘了包括一个脚本标签的角的ui-路由器。我把脚本标签放在角形的后面:
link(href='libraries/normalize-css/normalize.css', rel='stylesheet')
link(href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css', rel='stylesheet')
link(href='custom.css', rel='stylesheet')
script(src='libraries/angular/angular.js')
script(src='libraries/angular-ui-router/angular-ui-router.js')
script(src='/js/app.js')然后我把它包含在我的app.js中:
var myApp = angular.module('myApp', ['ui.router']);https://stackoverflow.com/questions/33505977
复制相似问题