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 { computed, get } from '@ember/object'; | |
export default Ember.Controller.extend({ | |
isButtonOn: false, | |
// This toggle will run when the button is pressed, it should toggle the isButtonOn property | |
// which should trigger the value of text to recompute | |
// -- begin edit area | |
toggle () { | |
}, |
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 Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
/** | |
Recreate the same functionality as the previous ember twiddle using Glimmer/Octane | |
tracked properties and action decorator | |
**/ | |
export default class ApplicationController extends Controller { | |
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 Component from '@glimmer/component'; | |
import { action } from '@ember/object'; | |
import { tracked } from '@glimmer/tracking'; | |
export default class extends Component { | |
@tracked | |
newDev = ""; | |
@action | |
onChange (e) { |
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 { computed } from '@ember/object'; | |
export default Ember.Component.extend({ | |
checked: true, | |
isChecked: computed(function() { | |
return !!this.get('checked'); | |
}), | |
actions:{ | |
toggleChecked: function(e) { |
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
function getRandom(max) { | |
return Math.floor(Math.random() * Math.floor(max)); | |
} | |
let input = ['Tyrion', 'Daenerys', 'Bronn', 'Margaery', 'Brienne']; | |
let output = ''; | |
let gives = [...input]; | |
let receives = [...input]; | |
let giverObj = {}; |
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
let input = `NumberA, NumberB, String | |
1, 2, hello | |
2, 4, world | |
3, 6, !` | |
let splitInput = input.split('\n'); | |
let labels = splitInput[0].split(','); | |
let ary = []; |