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
python -m SimpleHTTPServer 8000 |
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
// Example 1 | |
updateProviders(next) { | |
var matrix = this.get('allPatientProviderMatrix'); | |
var curledMatrix = {matrix}; // wrap array in {} to JSONify | |
var ember = this; | |
new Promise( function(resolve, reject) { | |
var localEmber = ember; | |
Ember.$.ajax({ | |
type: "POST", | |
url: ENV.fullApiUrl+'/matrix/' + localEmber.get('model.report.id'), |
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
isSomething: Ember.computed.alias('model.something'), // boolean | |
actions: { | |
checkSomething() { | |
this.toggleProperty('model.something'); | |
}, | |
} |
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
{% assign product_vendor_handle = product.vendor | handle %} | |
{% if collections[product_vendor_handle].handle == product_vendor_handle %} | |
{% assign vendor_url = collections[product_vendor_handle].url %} | |
{% else %} | |
{% assign vendor_url = product.vendor | url_for_vendor %} | |
{% endif %} | |
<div id="product-vendor"><span class="product-vendor">{{ product.vendor | link_to: vendor_url }}</span></div> |
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
{% assign finalsale_in_cart = false %} | |
{% for item in cart.items %} | |
{% capture tag_pile %} | |
{% for tag in item.product.tags %} | |
{{ tag }} | |
{% endfor %} | |
{% endcapture %} | |
{% if tag_pile contains 'Jewelry' or tag_pile contains 'Swim' or tag_pile contains 'Intimate' %} |
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
// Nested eaches don't work, as per Ember rules: | |
// computedOrderSubTotal: computed('allOrderItems.@each.properties.@each.qty') [....] | |
// Workaround: | |
nestedProperties: computed.mapBy('allOrderItems', 'properties'), | |
computedOrderSubTotal: computed('nestedProperties.@each.qty', 'nestedProperties.@each.pricePerUnit', { | |
get() { | |
return this.get('nestedProperties').map( item => item.pricePerUnit * item.qty).reduce( (a,b) => a + b, 0); | |
}, |
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'; | |
import moment from 'moment'; | |
const { computed } = Ember; | |
export default Ember.Component.extend({ | |
classNames: 'date-picker', | |
inputDate: null, |
NewerOlder