我试图设置一个应用程序,但我收到了一些奇怪的行为。我有两条路线:“welcome”,它映射到“/”;和“功能”,映射到“/功能”。导航到“/”时,欢迎模板正确呈现。但是,当我导航到“/ features”时,它仍然呈现欢迎模板。Ember只渲染根模板
这个jsbin实际上工作正常:http://jsbin.com/OSoFeYe/1,但下面的代码,这是从我的应用程序,没有。
App.Router.map(function() {
this.route("welcome", {path: "/"});
this.resource("features", {path: "/features"}, function() {
this.route("new");
});
});
App.FeaturesIndexRoute = Ember.Route.extend({
});
<body>
<div class="container">
<script type="text/x-handlebars">
<h1>rendered application template</h1>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="features">
<h2>Render features</h2>
<h6>Done features template</h6>
</script>
<script type="text/x-handlebars" data-template-name="welcome">
<h2>Render welcome</h2>
</script>
</div>
</body>
任何有关这个问题的见解,将不胜感激。
所以,功能链接到“http:// localhost:3000/features#/ features”链接,并正确呈现功能模板。但是,如果我转到“http:// localhost:3000/features”,它仍会呈现欢迎模板。 –