I have an ember app which had code like this:
App.AccountListingsView = Ember.View.extend({
didInsertElement: function() {
console.log('did this fire');
}
});
Every time I transition into this view, it fires whatever is in the didInsertElement (This works fine) However... after loading the view, I'd like it to fire only once. I don't need it to fire every time I go back to this page/view.
Is there a better way to execute code so that it fires once after a view is rendered, and not again when you navigate off of that view and back to it again? As of now, if I go into another view and back to the listings view it fires again in the console.
didInsertElement. The bindings will be unique to each instance of the view, just in case it's destroyed and re-rendered upon transition, as you are suggesting. - Matthew Blancarte