Skip to content

Instantly share code, notes, and snippets.

@3gwebtrain
Last active January 22, 2018 13:31
Show Gist options
  • Save 3gwebtrain/a82681e0f38cb1f62f90c1b14cbc16d9 to your computer and use it in GitHub Desktop.
Save 3gwebtrain/a82681e0f38cb1f62f90c1b14cbc16d9 to your computer and use it in GitHub Desktop.
Partial
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('my-route');
this.route('my-service');
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.parent{
border:2px dashed gray;
}
<h1>Welcome to Home page </h1>
{{#link-to 'my-route'}}My Route{{/link-to}}
{{#link-to 'my-service'}}My Service{{/link-to}}
<br>
<br>
{{outlet}}
<br>
<br>
<div class="parent">
<h2>Loaded from component default</h2>
{{ yield }}
</div>
<h2>This is my Route page</h2>
{{#my-component}}
{{partial "partials/my-route-partial"}}
{{/my-component}}
<h2>This is my Service page</h2>
{{#my-component}}
{{partial "partials/my-service-partial"}}
{{/my-component}}
<div>
Partial for Service only
</div>
{
"version": "0.13.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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment