Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
    <script src="http://builds.emberjs.com/release/ember.js"></script>
    <meta charset=utf-8 />
    <title>JS Bin</title>
</head>
<body>
<script type="text/x-handlebars">
    {{view App.MyView}}
</script>
<script type="text/x-handlebars" data-template-name="myview">
    <h1>My View</h1>
    Here, I would like to get the MyViewController, but I get
    <p>Controller: {{controller}}</p>
    <p>View: {{this}}</p>
    
    <p>Found it through the back door: {{ifoundit}}</p>
</script>
</body>
</html>
 
  App = Ember.Application.create();
  App.MyView = Ember.View.extend({
      templateName: "myview",
  });
  App.MyViewController = Ember.ObjectController.extend({
      needs: "application",
  });
  App.ApplicationController = Ember.ObjectController.extend({
  });
    App.ApplicationRoute = Ember.Route.extend({
        model: function(params) {
          return {
            ifoundit: this.controllerFor('myView').constructor
          }
        }
    });
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers