This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
tempValue: '', | |
actions: { | |
changeValue: function(value) { | |
this.set('tempValue', '123'); | |
console.log('got', value); | |
console.log('setting tempValue', this.get('tempValue')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP="example" | |
AUTO_VERSION="git-revision" | |
BUILD_AT="/tmp/erlang/example/builds" | |
DELIVER_TO="/var/web" | |
BUILD_HOST="build.app.example.com" | |
BUILD_USER="builder" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
// import connect from 'ember-redux/components/connect'; | |
import hbs from 'htmlbars-inline-precompile'; | |
export default Ember.Component.extend({ | |
layout: hbs`<h2>Hi there!</h2>` | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import connect from 'ember-redux/components/connect'; | |
var stateToComputed = (state) => { | |
return { | |
number: state.number | |
}; | |
}; | |
var dispatchToActions = (dispatch) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Mixin.create({ | |
isSubscribedToStore: false, | |
store: service('redux'), | |
state: computed(function() { | |
return get(this, 'store').getState(); | |
}), | |
init() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default Route.extend({ | |
model() { | |
get(this, 'backend').fetch('users').then(users => { | |
// Pretend `.receive` is a helper method that does .dispatch({ type: 'RECEIVE', ...args }) | |
get(this, 'store').receive({ users }); | |
}) | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import hbs from 'htmlbars-inline-precompile'; | |
import connect from 'ember-redux/components/connect'; | |
import npmCashay from '../npm-shims/cashay'; | |
const { Component } = Ember; | |
const { cashay } = npmCashay; | |
const stateToComputed = () => { | |
const { users } = cashay.query(`{ users { id, name } }`).data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
A basic GraphQL query. | |
Using ember-redux, the result of the Cashay GraphQL query | |
is connected to the component. | |
*/ | |
import Ember from 'ember'; | |
import hbs from 'htmlbars-inline-precompile'; | |
import connect from 'ember-redux/components/connect'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import hbs from 'htmlbars-inline-precompile'; | |
import connect from 'ember-redux/components/connect'; | |
var stateToComputed = (state) => { | |
return { | |
number: state.number | |
}; | |
}; |