Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Ember Starting Point v1.0.0-rc.3" />
<meta charset=utf-8 />
<title>Ember Starting Point</title>
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://builds.emberjs.com.s3.amazonaws.com/handlebars-1.0.0-rc.4.js"></script>
  <script src="https://machty.s3.amazonaws.com/ember/ember-async-routing-9.js"></script>
</head>
<body>
  <div>
      <div>
          <div>
              <div>
                  <div>
                      <div>
                          <div>
                              <div>
                                  <div></div>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
          </div>
      </div>
  </div>
  
</body>
</html>
 
App = Ember.Application.create({});
App.Router.map(function() {
  this.route('form');
});
App.FormRoute = Ember.Route.extend({
  events: {
    willTransition: function(transition) {
      if(!this.controller.get('canNavigate')) {
        alert('non-empty form!');
        transition.abort();
      }
    }
  }
});
App.ApplicationController = Ember.Controller.extend({
  currentPathDidChange : function () {
     console.log(this.get('currentPath'));
  }.observes('currentPath')
  
  
});
App.FormController = Ember.Controller.extend({
  canNavigate: Ember.computed.empty('name'),
  getBack : function () {
    window.history.back();
  }
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers