Skip to content

Instantly share code, notes, and snippets.

@ahmetemrekilinc
ahmetemrekilinc / controllers.application.js
Created September 26, 2019 06:25
ember-select-example
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
value: 'Hardcover',
actions: {
updateValue(event){
console.log(event.target.value);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<button onclick='myButtonClickHandler()'>
my button
@ahmetemrekilinc
ahmetemrekilinc / .eslintrc.js
Last active February 21, 2019 11:16
eslint-plugin-jsdoc
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
extends: [
@ahmetemrekilinc
ahmetemrekilinc / controllers.application.js
Last active February 21, 2019 08:35
ember-link-to-helper
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
twoway: "twoway",
oneway: "oneway",
actions: {
sampleFunction(){
@ahmetemrekilinc
ahmetemrekilinc / controllers.application.js
Last active November 7, 2018 09:27
ember-loading-example
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@ahmetemrekilinc
ahmetemrekilinc / controllers.application.js
Last active November 5, 2018 12:02
ember-set-example
import Ember from 'ember';
import {set} from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
checkboxList: [{"VALUE": "Content"}],
actions:{
updateValue(){
@ahmetemrekilinc
ahmetemrekilinc / controllers.application.js
Last active November 5, 2018 08:57
ember-checkbox-target-id
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
checkboxAction(e){
if(e.target.checked){
this.set("selectedTargetId", e.target.id);
}
@ahmetemrekilinc
ahmetemrekilinc / components.my-component.js
Last active November 6, 2018 18:38
ember-test-action
import Ember from 'ember';
export default Ember.Component.extend({
x: 5,
actions:{
incrementX(){
this.set('x', this.get('x') + 1);
this.get("someAction")();
}
@ahmetemrekilinc
ahmetemrekilinc / controllers.application.js
Last active November 2, 2018 12:14
ember-push-vs-pushObject
import Ember from 'ember';
import {computed} from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember push vs pushObject',
mylist: [1, 2],
mylistsize: computed('mylist.[]', function(){
return this.get('mylist').length;