Nie jestem pewien, jak podłączyć gniazda z nowym podejściem routera.nowe trasy ember.js: jak podłączyć punkty sprzedaży?
index.html:
...
<script type="text/x-handlebars" data-template-name="application">
<h4>The application handelbar</h4>
{{! outlet 1}}
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
<h4>The index handelbar</h4>
{{! outlet 2 and 3}}
{{outlet nav}}
{{outlet main}}
</script>
<script type="text/x-handlebars" data-template-name="main">
<h4>The main handelbar</h4>
</script>
<script type="text/x-handlebars" data-template-name="nav">
<h4>The nav handelbar</h4>
</script>
...
app.js:
...
App.Router.map(function(match) {
this.resource("index", { path: "/" });
this.route("test");
});
App.IndexController = Ember.Controller.extend({
});
App.IndexView = Ember.View.extend({
templateName: 'index'
});
...
Kod ten powoduje wylot-1.
Pytania:
- Dlaczego wylot-1 renderowane? W jaki sposób połączone są outlet-1 i "index"?
- Jak mogę podłączyć gniazda 2 i 3 do tej samej strony "indeksu"?
Dzięki
MIW
Bardzo dobre wyjaśnienie, dziękuję! – user1984778
bez problemu, z przyjemnością pomogę :) – hankang