Created
August 22, 2018 05:12
-
-
Save kevinkucharczyk/60118b9d787b8be8a283cd4ac0029bd3 to your computer and use it in GitHub Desktop.
Campaign Options
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'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
willExit: computed('model.{exitOnAction,exitOnConversion}', function() { | |
return this.get('model.exitOnAction') || this.get('model.exitOnConversion'); | |
}), | |
neverExit: computed.not('willExit'), | |
actions: { | |
neverExitSelected() { | |
let model = this.get('model'); | |
model.set('exitOnAction', false); | |
model.set('exitOnConversion', false); | |
}, | |
exitSelected() { | |
let model = this.get('model'); | |
model.set('exitOnAction', true); | |
} | |
} | |
}); |
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 Model from "ember-data/model"; | |
import attr from "ember-data/attr"; | |
import { belongsTo, hasMany } from "ember-data/relationships"; | |
export default Model.extend({ | |
exitOnAction: attr('bool'), | |
exitOnConversion: attr('bool') | |
}); |
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({ | |
model() { | |
let campaign = this.store.createRecord('campaign', { | |
exitOnAction: true, | |
exitOnConversion: false | |
}); | |
return campaign; | |
} | |
}); |
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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.mrg-l-lg { | |
margin-left: 30px; | |
} | |
.mrg-t-sm { | |
margin-top: 10px; | |
} | |
.mrg-t-lg { | |
margin-top: 30px; | |
} | |
.pad-t-lg { | |
padding-top: 20px; | |
} | |
.font-xl-and-red { | |
color: red; | |
font-size: 24px; | |
} | |
.border-top { | |
border-top: 1px solid black; | |
} |
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.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.2.2", | |
"ember-template-compiler": "3.2.2", | |
"ember-testing": "3.2.2" | |
}, | |
"addons": { | |
"ember-data": "3.2.0", | |
"ember-truth-helpers": "2.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment