windows 10 pro office 2019 pro office 365 pro windows 10 home windows 10 enterprise office 2019 home and business office 2016 pro windows 10 education visio 2019 microsoft project 2019 microsoft project 2016 visio professional 2016 windows server 2012 windows server 2016 windows server 2019 Betriebssysteme office software windows server https://softhier.com/ instagram takipçi instagram beğeni instagram görüntüleme instagram otomatik beğeni facebook beğeni facebook sayfa beğenisi facebook takipçi twitter takipçi twitter beğeni twitter retweet youtube izlenme youtube abone instagram

Ember does not render after transition

Asked By: Anonymous

I have just written extremly simple Ember app, built on top of the Rails app, working with Ember Data and displaying, creating and persisting just one entity type to the server. Everything with the latest tools (Ember v1.0.0-pre.4-134-gaafb5eb).

However, there is very strange problem I have encountered. My app has two views: entity list (index) and form for creating new entities. When I enter the index directly, everything displays OK. But when I go to the other view and then back to the list, the view is not rendered again. Where could be the problem?

I guess it might be caused by my (maybe incorrect) using new Ember router. So I’m pasting important (from my point of view) parts of the app here:

Router:

App.Router.map(function() {
  this.resource('bands', function() {
    this.route('new');
  });
});

App.IndexRoute = Ember.Route.extend({
  redirect: function() {
    this.transitionTo('bands');
  }
});

App.BandsRoute = Ember.Route.extend({
    model: function() {
        return App.Band.find();
    }
});

App.BandsNewRoute = Ember.Route.extend({
    renderTemplate : function(){
        this.render('bands_new',{
            into:'application'
        });
    }
});

Link back to list – which does not work:

App.BandsNewController = Em.ArrayController.extend({
    cancel: function() {
        this.transitionTo('bands');
    }
});

Have a look at the whole app here: https://github.com/pavelsmolka/roommating
(It’s hugely inspired by great https://github.com/dgeb/ember_data_example)

I don’t believe it, but could it be bug in Ember itself?


Solution

Answered By: Anonymous

I think your “render” call in your BandsNewRoute is messing things up.Try making things go more with Ember defaults. So I would refactor your app to do this:

(working fiddle: http://jsfiddle.net/andremalan/DVbUY/)

Instead of making your own render, all you need to do is create a “bands” template (it can be completely empty except for {{outlet}} if you want) and a “bands.index” template.

<script type="text/x-handlebars" data-template-name="application">
    {{outlet}}
</script>


<script type="text/x-handlebars" data-template-name="bands/index">
    <h2>Bands Index</h2>
    {{#linkTo bands.new}}New Band{{/linkTo}}
</script>

<script type="text/x-handlebars" data-template-name="bands">
    <h1>Bands</h1>
    <p>
      {{#linkTo index}}Start Again{{/linkTo}}
      {{#linkTo bands.new}}New Band{{/linkTo}}
    </p>
    {{outlet}}
</script>

<script type="text/x-handlebars" data-template-name="bands/new">
    I'm in new band!
    <a {{action "cancel"}}>Cancel</a>
</script>

Your routes also clean up really nicely this way:

App.Router.map(function() {
    this.resource('bands', function() {
        this.route('new');
    });
});

App.IndexRoute = Ember.Route.extend({
  redirect: function() {
    this.transitionTo('bands');
  }
});


App.BandsNewController = Ember.Controller.extend({
    cancel: function() {
        this.transitionTo('bands');
    }
});

I hope that helps!

techinplanet staff

instagram volgers kopen volgers kopen buy windows 10 pro buy windows 11 pro


Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno
Alanya escort Manavgat escort Fethiye escort Kemer escort Didim escort Çanakkale escort Aydın escort Muğla escort Tekirdağ escort Manisa escort Balıkesir escort Trabzon escort Elazığ escort Ordu escort Kütahya escort Isparta escort Rize escort Kahramanmaraş escort Yalova escort Giresun escort Yozgat escort Tokat escort Şanlıurfa escort Sivas escort Batman escort Erzurum escort Sinop escort Kırşehir escort Karaman escort Kırıkkale escort Bolu escort Amasya escort Niğde escort Uşak escort Edirne escort Çorum escort Osmaniye escort Zonguldak escort Van escort Erzincan escort Söke escort Bodrum escort Çerkezköy escort Akhisar escort Bandırma escort Ayvacık escort Akçaabat escort Karakoçan escort Altınordu escort Tavşanlı escort Eğirdir escort Ardeşen escort Afşin escort Altınova escort Bulancak escort Sorgun escort Erbaa escort Viranşehir escort Zara escort Kozluk escort Aziziye escort Ayancık escort Kaman escort Ermenek escort Keskin escort Gerede escort Göynücek escort Bor escort Banaz escort Havsa escort Osmancık escort Bahçe escort Alaplı escort Başkale escort Kemah escort Nazilli escort Fethiye escort Çorlu escort Alaşehir escort Altıeylül escort Biga escort Araklı escort Kovancılar escort Fatsa escort Simav escort Yalvaç escort Çayeli escort Dulkadiroğlu escort Çiftlikköy escort Espiye escort Sarıkaya escort Niksar escort Suruç escort Yıldızeli escort Sason escort Horasan escort Boyabat escort Mucur escort Sarıveliler escort Yahşihan escort Göynük escort Gümüşhacıköy escort Çamardı escort Eşme escort İpsala escort Sungurlu escort Hasanbeyli escort Çaycuma escort İpekyolu escort Refahiye escort Kuşadası escort Marmaris escort Süleymanpaşa escort Turgutlu escort Susurluk escort Gelibolu escort Of escort Ünye escort Domaniç escort Fındıklı escort Elbistan escort Çınarcık escort Tirebolu escort Akdağmadeni escort Turhal escort Eyyübiye escort Suşehri escort Yakutiye escort Gerze escort Mengen escort Merzifon escort Ulukışla escort Sivaslı escort Keşan escort Kadirli escort Ereğli escort Özalp escort Tercan escort Efeler escort Didim escort Çine escort Dalaman escort Menteşe escort Milas escort Ortaca escort Seydikemer escort Ergene escort Kapaklı escort Malkara escort Salihli escort Şehzadeler escort Soma escort Yunusemre escort Ayvalık escort Bigadiç escort Burhaniye escort Gönen escort Karesi escort Çan escort Yenice escort Ortahisar escort Yomra escort Perşembe escort Pazar escort Onikişubat escort Pazarcık escort Türkoğlu escort Eynesil escort Görele escort Piraziz escort Yağlıdere escort Çayıralan escort Boğazlıyan escort Zile escort Siverek escort Karaköprü escort Haliliye escort Akçakale escort Şarkışla escort Gemerek escort Oltu escort Palandöken escort Mudurnu escort Suluova escort Taşova escort Toprakkale escort Kilimli escort Tuşba escort Üzümlü escort