Backbone.js 在Playframework 2中使用胡须模板
嗨,我正在尝试在playframework 2中使用胡须模板。所以我的index.scala.html看起来像Backbone.js 在Playframework 2中使用胡须模板,backbone.js,playframework,playframework-2.0,Backbone.js,Playframework,Playframework 2.0,嗨,我正在尝试在playframework 2中使用胡须模板。所以我的index.scala.html看起来像 @import com.feth.play.module.pa.views.html._ <!doctype html> <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="e
@import com.feth.play.module.pa.views.html._
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<title>Test</title>
<script data-main="@routes.Assets.at("javascripts/main.js")" src="@routes.Assets.at("javascripts/require.js")"></script>
<body>
<header>
</header>
</body>
</html>
View.HeaderView.Html的定义如下
<div id="auth-status">
@currentAuth() { auth =>
@if(auth != null) {
<div class="btn-group pull-right" id="auth-loggedin" style="display:auto">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<i class="icon-user" id="auth-displayname"></i> Welcome
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Settings</a></li>
<li class="divider"></li>
<li><a href="@com.feth.play.module.pa.controllers.routes.Authenticate.logout" id="auth-logoutlink">Sign Out</a></li>
</ul>
</div>
}
@if(auth == null) {
@forProviders() { p =>
<div class="btn pull-right" id="auth-loggedout">
<a href="@p.getUrl()" id="auth-loginlink">
<i class="icon-user"></i> Login With Facebook</a>
</div>
}
}
}
</div>
@currentAuth(){auth=>
@如果(auth!=null){
}
@if(auth==null){
@forProviders(){p=>
}
}
}
所以我遇到的问题是scala模板显示为常规文本,而不是scala代码。如果我将代码放在index.scala.html中,它就会工作
救命啊 您的
View.HeaderView.Html
文件未检测为scala代码,并且未执行/编译
- 首先,将其放入应用程序的
包中李>视图
- 其次,使用
扩展名。否则编译器将找不到它李>.scala.html
视图.HeaderView.Html
文件未检测为scala代码,并且未执行/编译
- 首先,将其放入应用程序的
包中李>视图
- 其次,使用
扩展名。否则编译器将找不到它李>.scala.html
<div id="auth-status">
@currentAuth() { auth =>
@if(auth != null) {
<div class="btn-group pull-right" id="auth-loggedin" style="display:auto">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<i class="icon-user" id="auth-displayname"></i> Welcome
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Settings</a></li>
<li class="divider"></li>
<li><a href="@com.feth.play.module.pa.controllers.routes.Authenticate.logout" id="auth-logoutlink">Sign Out</a></li>
</ul>
</div>
}
@if(auth == null) {
@forProviders() { p =>
<div class="btn pull-right" id="auth-loggedout">
<a href="@p.getUrl()" id="auth-loginlink">
<i class="icon-user"></i> Login With Facebook</a>
</div>
}
}
}
</div>