Skip to content

Instantly share code, notes, and snippets.

hsc.models.initStore = ->
server = require('com.obscure.TiTouchDB');
hsc.models.db = db = server.databaseNamed('hackersc');
db.ensureCreated();
hsc.models.design = design = db.designDocumentWithName 'hsc'
currentRoundMap = "
function(doc) {
if (doc.type === 'round' && doc.status === 'current')
if 9 >= holeNumber >= 1
outScore += holeScore if holeScore
outToPar += holeScore - par if par.length and holeScore
else
inScore += holeScore if holeScore
inToPar += holeScore - par if par.length and holeScore
calculateScore: ->
totalToPar = 0
holes = @get 'holes'
score = 0
outScore = 0
outToPar = 0
inScore = 0
inToPar = 0
for hole in holes
owView = hsc.ui.View.create
contentDisplayProperties: ['description']
createChildViews: (container) ->
container.left = 0
container.right = 0
container.top = 0
container.bottom = 0
@label = Ti.UI.createLabel
{{#my-modal}}
{{my-form saveComplete=(action 'hideModal')}}
{{/my-modal}}
@hvgotcodes
hvgotcodes / components.my-form.js
Last active August 9, 2016 20:53
ModalsAreDifficult
import Ember from 'ember';
export default Ember.Component.extend({
});
In comp-a
Ember.extend(...
didSave(){
// default implementation
}
actions: {
onSave() {
In component Chainer
Ember.extend.... {
first(){},
second(){},
actions: {
chain(){
import Ember from 'ember';
import Chainer from 'app/components/my-chainer'
export default Chainer.extend({
first(){
console.log('subclass first', this)
}
});
import Ember from 'ember';
export default Ember.Component.extend({
scope: 'inner',
actions: {
fromOuter(){},
clicked(){
console.log('clicked', this.get('scope'));
this.get('fromOuter')();
}