Skip to content

Instantly share code, notes, and snippets.

@zackthehuman
Created November 8, 2016 20:02
Show Gist options
  • Save zackthehuman/e0aa848b83b18a52c611c93e081420c4 to your computer and use it in GitHub Desktop.
Save zackthehuman/e0aa848b83b18a52c611c93e081420c4 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
const AppA = {
appInstance: {
name: 'App A!',
foo: 'This is a foo!'
}
};
const AppB = {
appInstance: {
name: 'App B!',
foo: 'This is another foo value!'
}
};
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
currentApp: null,
actions: {
changeApp(appName) {
this.set('currentApp', appName === 'A' ? AppA : AppB);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{sso-config appInstance=currentApp.appInstance}}
<button {{action 'changeApp' 'A'}}>Change to A</button>
<button {{action 'changeApp' 'B'}}>Change to B</button>
<br>
<br>
<p>Name: {{appInstance.name}}</p>
<p>Foo: {{appInstance.foo}}</p>
{
"version": "0.10.6",
"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.9.0",
"ember-data": "2.9.0",
"ember-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment