- windows:
<path to chrome>/chrome.exe --remote-debugging-port=9222
- macOS:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
- linux:
google-chrome --remote-debugging-port=9222
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
actions: { | |
test() { | |
this.model.forEach(person => person.rollbackAttributes()); | |
this.store.push({ | |
data: { | |
// primary data for single record of type `Person` |
if(!("valueAsDate" in HTMLInputElement.prototype)){ | |
Object.defineProperty(HTMLInputElement.prototype, "valueAsDate", { | |
get: function(){ | |
var d = this.value.split(/\D/); | |
return new Date(d[0], --d[1], d[2]); | |
}, | |
set: function(d){ | |
var day = ("0" + d.getDate()).slice(-2), | |
month = ("0" + (d.getMonth() + 1)).slice(-2), | |
datestr = d.getFullYear()+"-"+month+"-"+day; |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
actions: { | |
showText() { | |
// this throws an error of exampleFun is not a function | |
// in ember > 3.2 when ec-mirage is enabled | |
this.model.exampleFun(); | |
} | |
} |
import Adapter from 'ember-data/adapters/json-api'; | |
import Ember from 'ember'; | |
import RSVP from 'rsvp'; | |
const { Promise } = RSVP; | |
const { get } = Ember; | |
class Transaction { | |
constructor(store, ModelClass, primary, transactionMembers) { | |
this.store = store; |
import Ember from 'ember'; | |
import hbs from 'htmlbars-inline-precompile'; | |
export default Ember.Component.extend({ | |
layout: hbs`{{yield sortedItems}}`, | |
sortedItems: Ember.computed('[email protected]', 'sort', function() { | |
const sort = this.get('sort'); | |
const sorted = [...this.get('data')].sort((a, b) => { | |
if (sort === 'up') return a.id - b.id; | |
return b.id - a.id; |
import Ember from 'ember'; | |
// it makes the issue of async really simple, in that you just care about the array {{my-component}} yields out | |
// it may at some times be empty, it may have some stuff later -- you're just binding to it. No promises for you to worry about | |
// you could do the same thing with the API call currently in your controller, and then break out code that consumes that data into other components. | |
// to make this even fancier, you could add Ember.run.debounce to avoid race conditions | |
export default Ember.Component.extend({ | |
term: '', | |
init() { | |
this._super(...arguments); | |
this.set('results', []); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Concurrency Decendants' | |
}); |