0

Hi i'm writing a simple ember app that I run within a node-webkit app, now I would like to run:

require("nw.gui").Window.get().show();

right after Ember finished loading and had rendered the index view, but just once, not if you've just navigated to /.

I've tried this:

App.IndexRoute = Ember.Route.extend({
  setupController: function(controller) {
    require("nw.gui").Window.get().show();
  }
});

But this executes on each navigation to /

Thanks!

Leon Fedotov
  • 7,421
  • 5
  • 30
  • 33

1 Answers1

2

Ember.Application has a ready event. That could match your needs.

You can use it like this:

window.App = Ember.Application.create({
    ready: function () {
        alert('Application ready!');
    }
});
Mutual Exception
  • 1,240
  • 12
  • 27