Created
February 29, 2016 11:00
-
-
Save lovelykaushik86/c91a6547ea9a12de4810 to your computer and use it in GitHub Desktop.
New Twiddle
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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
people: [{id:"user1", firstname: "user1"},{id:"user1", firstname: "user1"},{id:"user1", firstname: "user1"},{id:"user1", firstname: "user1"},{id:"user1", firstname: "user1"},{id:"user1", firstname: "user1"}], | |
test:"testing" | |
}); |
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'; | |
export default Ember.Component.extend({ | |
init: function(){ | |
var tmp = '<select class="multi" multiple="multiple">' | |
+ '{{#each person in options}}' | |
+ '<option {{bind-attr value="person.id"}}>{{person.firstName}}</option>' | |
+'{{/each}}' | |
+'</select>'; | |
this.set('dynamicTemplate', tmp); | |
this.set('layout', Ember.Handlebars.compile(this.get('dynamicTemplate'), true)); | |
this._super(); | |
}, | |
_initializeMulti: (function() { | |
return $(".multi").multiSelect({ | |
afterSelect: (function(_this) { | |
return function(values) { | |
return _this.sendAction("addAction", values); | |
}; | |
})(this), | |
afterDeselect: (function(_this) { | |
return function(values) { | |
return _this.sendAction("removeAction", values); | |
}; | |
})(this) | |
}); | |
}).on("didInsertElement") | |
}); |
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
{ | |
"version": "0.6.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.3.1/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment