Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Ember.js索引不工作_Javascript_Asp.net Mvc_Ember.js - Fatal编程技术网

Javascript Ember.js索引不工作

Javascript Ember.js索引不工作,javascript,asp.net-mvc,ember.js,Javascript,Asp.net Mvc,Ember.js,我正在尝试在ASP.NET MVC5应用程序中创建一个Ember.js SPA。我正在使用下面的Web链接提供的示例项目。在其中,我创建了一个新的index.cshtml以及application.js和routes.js文件。但是,未执行把手模板。下面是我的代码。有人知道为什么这不起作用吗 我想要的只是显示带有“关于”文本的菜单,并单击“关于”链接查看“关于此应用…”文本。目前,我看到的只是文本“testabout”,所以我倾向于相信实现是正确的 EfaAppTabs.cshtml <

我正在尝试在ASP.NET MVC5应用程序中创建一个Ember.js SPA。我正在使用下面的Web链接提供的示例项目。在其中,我创建了一个新的index.cshtml以及application.js和routes.js文件。但是,未执行把手模板。下面是我的代码。有人知道为什么这不起作用吗

我想要的只是显示带有“关于”文本的菜单,并单击“关于”链接查看“关于此应用…”文本。目前,我看到的只是文本“testabout”,所以我倾向于相信实现是正确的

EfaAppTabs.cshtml

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="Content/bootstrap.css" rel="stylesheet" />
</head>
<body>    
    <h1>Test About</h1>
    <script type="text/x-handlebars" data-template-name="EfaEmberApp-1.0.0">
        <div class="container">
            <div class="page-header">
                <h1>Movies</h1>
            </div>
            <div class="well">
                <div class="navbar navbar-static-top">
                    <div class="navbar-inner">
                        <ul class="nav nav-tabs">
                            <li>{{#linkTo 'about'}}About{{/linkTo}} </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="container">
                <div class="row">
                    {{outlet}}
                </div>
            </div>
        </div>
        <div class="container">
            <p>&copy;2018 EFA</p>
        </div>
    </script>


    <script type="text/x-handlebars" data-template-name="about">
        <div class="container"></div>
        <h3>About this app...</h3>
    </script>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jquery-ui")
    @Scripts.Render("~/bundles/ember")
    @Scripts.Render("~/bundles/Efa")
</body>
</html>
eFamberRoutes-1.0.0.js

window.App = Ember.Application.create();
// Routes
App.Router.map(function () {
    this.route('about');
});

那个模板已经过时了。我建议你不要用它。@Lux好的。还有什么可以推荐的替代方案吗?请将asp.net后端与ember应用程序分开。使用
ember cli
进行ember开发。这是唯一明智的选择。这是最好的开始。对于交互式讨论,可以加入讨论论坛和slack频道。也许你应该以更健谈的方式进行讨论(提示:slack)。但是如果你选择一个SPA,你总是将你的客户端和后端分开。asp.NETMVC将作为ember的后端运行良好。另外,VisualStudio代码是ember的优秀IDE。然而,使用SPA的事实意味着它总是比服务器MVC框架的
V
更重要。通常在最终构建之后集成它们以进行部署。