Last active
July 8, 2016 14:55
-
-
Save phillipkregg/20da92d62c8508b2aec473b57a93bab7 to your computer and use it in GitHub Desktop.
EmberBootstrap
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({ | |
property1: undefined, | |
property2: undefined, | |
actions: { | |
coolClick: function() { | |
this.set('property1', 'Yo'); | |
this.set('property2', 'Sup'); | |
alert('from component') | |
this.sendAction('action', { | |
property1: this.get('property1'), | |
property2: this.get('property2') | |
}); | |
this.sendAction('customActionName') | |
}, | |
defaultAction: function() { | |
this.set('property1', 'Yo'); | |
this.set('property2', 'Sup'); | |
alert('default'); | |
}, | |
sendState: function() { | |
var property1 = this.get('property1'); | |
var property2 = this.get('property2') | |
return { | |
property1: property1, | |
property2: property2 | |
} | |
} | |
} | |
}); |
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', | |
actions: { | |
defaultAction: function() { | |
alert('default from component to application controller'); | |
} | |
} | |
}); |
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({ | |
actions: { | |
} | |
}); |
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-button-route'); | |
}); | |
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({ | |
actions: { | |
goHome: function() { | |
this.transitionTo('index') | |
}, | |
goToFirst: function() { | |
this.transitionTo('first-button-route'); | |
} | |
} | |
}); |
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({ | |
currentViewState: undefined, | |
actions: { | |
coolClickAction: function() { | |
alert('from index route: cool click action') | |
}, | |
defaultAction: function(viewState) { | |
alert('default from component to index route' + ' ' + viewState); | |
// Call an action from within this route | |
this.send('setupViewState', viewState) | |
}, | |
setupViewState: function(viewState) { | |
this.set('currentViewState', viewState); | |
alert("Current View State: " + JSON.stringify(this.get('currentViewState'))); | |
} | |
} | |
}); |
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