Last active
July 10, 2016 02:23
-
-
Save phillipkregg/512bf19eb98e0ff29a9cf0397822b950 to your computer and use it in GitHub Desktop.
TestEmber
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.Component.extend({ | |
myInputValue: '', | |
actions: { | |
fromComponent: function() { | |
var message = this.get('myInputValue'); | |
debugger; | |
alert('from component'); | |
debugger; | |
this.sendAction('defaultAction', this.get('myInputValue')) | |
} | |
} | |
}); |
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', | |
oneWay: Ember.computed.oneWay('appName'), | |
actions: { | |
goHome: function() { | |
this.transitionToRoute('index'); | |
}, | |
goToFirst: function() { | |
this.transitionToRoute('first'); | |
}, | |
appName: function() { | |
alert(this.get('appName')); | |
} | |
} | |
}); |
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({ | |
}); |
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 config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('first', function() { | |
this.route('first-main'); | |
}); | |
}); | |
export default Router; |
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.Route.extend({ | |
}); |
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.Route.extend({ | |
}); |
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.Route.extend({ | |
// Private vars | |
inputValue: undefined, | |
burger: 'Mmmm burger!', | |
taco: 'Yummie taco!', | |
model: function() { | |
return { | |
// Create api fro private vars with whatever name | |
my_burger: this.get('burger'), | |
my_taco: this.get('taco'), | |
hotels: ['Marriott', 'Hyatt', 'Hilton'] | |
} | |
}, | |
actions: { | |
testIndex: function() { | |
alert('first from route!'); | |
}, | |
sendToRoute: function(message) { | |
this.set('inputValue', message); | |
alert("Here's the input value: " + this.get('inputValue') + " from router"); | |
}, | |
goToFirstMain: function() { | |
this.transitionTo('first-main'); | |
}, | |
goToFirstCreate: function() { | |
this.transitionTo('first-create'); | |
} | |
} | |
}); |
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
{ | |
"version": "0.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"bootstrap": "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css", | |
"ember": "2.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment