Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
  <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="http://builds.emberjs.com/canary/ember.debug.js"></script>
  <script src="http://builds.emberjs.com/canary/ember-template-compiler.js"></script>
</head>
<body>
  <div id='app'></div>
  <pre id="logs"></pre>
  
  <script type="text/x-handlebars">
    <h2>rwjblue's Ember JSBins</h2>
    <p>To use <code>(route-action)</code> in an ember-cli app, checkout <a href="https://github.com/dockyard/ember-route-action-helper">ember-route-action-helper</a></p>
    {{foo-bar clicked=(route-action 'dummy' 'some-arg')}}
  </script>
  <script type="text/x-handlebars" id="components/foo-bar">
    <button {{action clicked 'Clicked!'}}>Click Me!</button>
  </script>
</body>
</html>
 
/* Put your CSS here */
html, body {
    margin: 20px;
}
 
var App = Ember.Application.create({
  rootElement: '#app',
  LOG_RESOLVER: true
});
App.Router.map(function() {
});
App.ApplicationRoute = Ember.Route.extend({
  actions: {
    error: function(error) {
      log(error.message);
    },
    dummy() {
      log(...arguments);
    }
  }  
});
App.RouteActionHelper = Ember.Helper.extend({
  router: Ember.computed(function() {
    return Ember.getOwner(this).lookup('router:main');
  }),
  compute([actionName, ...params]) {
    let router = this.get('router');
    
    return function(...invocationArgs) {
      let args = params.concat(invocationArgs);
      router.send(actionName, ...args);
    }
  }
});
Ember.onerror = function(error) {
  log(error.stack);
};
function log() {
  var msg = [].slice.call(arguments).join(' ');
  logs.insertBefore(document.createTextNode("\n" + msg), logs.firstChild);
}
Output

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

Dismiss x
public
Bin info
rwjbluepro
0viewers