This file contains 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
//This is in the appliation route: | |
setupController:function(controller, model) { | |
this._super(controller, model); | |
this.filterable(['ingredient', 'recipe']).then(function(array) { | |
controller.set('itemCollection', array) | |
}); | |
}, |
This file contains 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
var MyRoute = Ember.Route.extend({ | |
model: function() { | |
// this will resolve | |
return Ember.$.ajax().then(function(data) { | |
// then this will resolve | |
return Ember.RSVP.hash({ | |
data: data, | |
items: Em.RSVP.all([ | |
Ember.$.ajax({url: data.item1url}), | |
Ember.$.ajax({url: data.item2url}) |
This file contains 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
{{#object-form for=this action="formSubmitted" buttonLabel="Click Me" formClass="narrow"}} | |
{{form-field for="email"}} | |
{{form-field for="password" label="Create new password" hint="Minimum 8 characters"}} | |
{{form-field for="passwordConfirmation" label="Confirm new password"}} | |
{{/object-form}} |
This file contains 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
StatsController = Ember.Controller.extend | |
currentSelection: Ember.computed -> | |
value = @store.createRecord('selection') | |
value.populate() | |
value |
This file contains 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'; | |
const { computed, get, set } = Ember; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
parts: computed('appName', { | |
get() { | |
return get(this, 'appName').split(' '); | |
}, |
This file contains 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({ | |
show: null, | |
menus: Ember.computed('model', function() { | |
return this.model; | |
}), | |
actions: { | |
showMatch(menu) { | |
//alert('Start'); |
This file contains 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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains 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({ | |
queryParams: ['b'], | |
a: "test", | |
b: Ember.computed('a', { | |
get() { | |
return this.get('a'); | |
}, | |
set(key, value) { |
This file contains 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 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
#original attribution https://gist.github.com/alexspeller/6251054 & https://gist.github.com/stevekane/6356006 | |
App.ClickElsewhereMixin = Ember.Mixin.create | |
#use this method hook to define your desired behavior | |
onClickElsewhere: Ember.K | |
#bound version of our instance method | |
clickHandler: Em.computed -> | |
Em.run.bind @, 'onClickElsewhere' |
OlderNewer