Skip to content

Instantly share code, notes, and snippets.

View feanor07's full-sized avatar

Alptug Dilek feanor07

  • Tekmetric
  • Ankara
View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
tagName:'input',
attributeBindings:['type','style','value'],
init() {
this._super(...arguments);
this.on('paste', this, this._elementValueDidChange);
this.on('cut', this, this._elementValueDidChange);
@feanor07
feanor07 / components.my-component.js
Last active December 7, 2016 10:54 — forked from cinkonaap/components.my-component.js
Mutable property passed from template
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
this.set('value', 0);
},
actions: {
up() {
import Ember from 'ember';
export default Ember.Component.extend({
name2: 'Micheal',
actions: {
name2DidChange: function() {
let value = this.$('#html_input').val();
this.set('name2', value);
}
}
@feanor07
feanor07 / components.my-component.js
Last active August 15, 2016 05:31 — forked from kumkanillam/controllers.application.js
StackOverflow Answer: 38940408
import Ember from 'ember';
export default Ember.Component.extend({
actions:{
changeAppAtComponent(){
this.set('appName','Kumkanillam');
}
}
});
@feanor07
feanor07 / components.my-component.js
Last active August 14, 2016 20:27 — forked from e00dan/components.my-component.js
StackOverflow Answer: 37618621
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['cursor-pointer'],
clickListener: Ember.on('click', function(){
let doSth = this.get('doSth');
if (doSth) {
console.log('Click listener is about to trigger action');
@feanor07
feanor07 / components.x-option.js
Last active August 14, 2016 20:26 — forked from FrontlineOscar/components.x-option.js
StackOverflow Answer: 37592666
import Ember from 'ember';
import XSelectComponent from './x-select';
var isArray = Ember.isArray;
/**
* Used to wrap a native `<option>` tag and associate an object with
* it that can be bound. It can only be used in conjuction with a
* containing `x-select` component
*