gokatz
2/13/2017 - 7:01 AM

renderTemplate with extends

renderTemplate with extends

{
  "version": "0.11.0",
  "EmberENV": {
    "FEATURES": {}
  },
  "options": {
    "use_pods": false,
    "enable-testing": false
  },
  "dependencies": {
    "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
    "ember": "2.10.2",
    "ember-data": "2.11.0",
    "ember-template-compiler": "2.10.2",
    "ember-testing": "2.10.2"
  },
  "addons": {}
}
<div style="background: blue; height:60px; position: absolute; width: 500px; left: 200px; color: white">
	<p>NEW SCREEN</p>
</div>
<div style="background: yellow; height:60px; position: absolute; top: 200px; width: 200px;">
	{{outlet}}
</div>
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#link-to 'inbox.create.new'}} Inbox {{/link-to}}
<br>
{{#link-to 'allfiles.create.new'}}  All files {{/link-to}}
<br>
{{#link-to 'application'}} Application {{/link-to}}

<hr>
{{outlet}}
 
{{outlet 'fullscreen'}}
import Ember from 'ember';

export default Ember.Route.extend({
});
import Ember from 'ember';

export default Ember.Route.extend({
  model() {
    var root = 'https://jsonplaceholder.typicode.com';
    return $.ajax({
      url: root + '/photos',
      method: 'GET'
    }).then(function(data) {
      return data;
    }); 
  },
  renderTemplate() {
    this.render('inbox.create.new', {
      into: 'inbox.create'
    });
  },

  controllerName: 'inbox.create.new',

});
import Ember from 'ember';

export default Ember.Route.extend({
    
  renderTemplate() {
    this.render('inbox.create', {
      into: 'application',
      outlet: 'fullscreen'
    });
  },
  
  controllerName: 'inbox.create'
});
import Ember from 'ember';

export default Ember.Route.extend({
});
import newRoute from 'app/routes/inbox/create/new';

export default newRoute.extend({
});
import createRoute from 'app/routes/inbox/create';

export default createRoute.extend({
});
import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: 'none',
  rootURL: config.rootURL
});

Router.map(function() {
  this.route('inbox', function() {
  	this.route('create', function() {
    	this.route('new');
    })
  })
  this.route('allfiles', function() {
  	this.route('create', function() {
    	this.route('new');
    })
  })
});

export default Router;
import Ember from 'ember';

export default Ember.Controller.extend({
  appName: 'Ember Twiddle'
});