Ember rc 6无法识别车把rc 4

时间:2013-07-16 03:18:48

标签: javascript asp.net-mvc asp.net-mvc-3 ember.js handlebars.js

我正在尝试开始学习Ember.js,我在页面加载时收到此错误:

Assertion failed: Ember Handlebars requires Handlebars version 1.0.0-rc.4. 
Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before 
you link to Ember.

然而,我去了Ember.js 'About' page并下载了入门套件。它带有以下文件:

  • 余烬-1.0 / 0-rc.6.js
  • 车把-1.0.0-rc.4.js
  • 的jquery-1.9.1.js

我在ASP MVC 3项目中这样做,所以这里有一些Razor语法,但这是我的_Layout.cshtml文件。我目前在Home Index页面中没有任何内容,因此这实际上是将加载到页面上的所有HTML。

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/ember-1.0.0-rc.6.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/handlebars-1.0.0-rc.4.js")" type="text/javascript"></script>
</head>
<body>
    <div class="page">
        <header>
            <div id="title">
                <h1>Bootstrap/Ember.js Sample Application</h1>
            </div>
        </header>
        <section id="main">
            @RenderBody()
        </section>
        <footer>
        </footer>
    </div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

刚刚解决了这个问题。不知道你需要在ember之前放置把手脚本。声明现在看起来像这样:

<script src="@Url.Content("~/Scripts/jquery-1.9.1.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/handlebars-1.0.0-rc.4.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/ember-1.0.0-rc.6.js")" type="text/javascript"></script>