Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
// using ember data records
channels: function() {
return [
this.get('store').createRecord('channel', { name: 'First channel' }),
this.get('store').createRecord('channel', { name: 'Second channel' })
import DS from 'ember-data';
export default DS.RESTAdapter;
@kumkanillam
kumkanillam / index.html
Created April 15, 2016 18:46 — forked from anonymous/index.html
Ember Starter Kit // source http://jsbin.com/febafarova
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://builds.emberjs.com/canary/ember.debug.js"></script>
<script src="http://builds.emberjs.com/canary/ember-template-compiler.js"></script>
import Ember from 'ember';
export default Ember.Controller.extend({
boxes:[{id:1},{id:2},{id:3}],
boxArr: Ember.computed('[email protected]', {
get() {
let disableOthers = Ember.get(this, 'boxes').filterBy('value', true).get('length') >= 2;
return Ember.get(this, 'boxes').map(({id, value}) => {
return {
id,
@kumkanillam
kumkanillam / components.range-slider.js
Created May 12, 2016 05:50
how-to-pass-controller-observed-property-in-component
import Ember from 'ember';
export default Ember.Component.extend({
tagName:'',
currentValue:function(){
return this.get('value');
}.property('value'),
minValue:function(){
return this.get('min');
@kumkanillam
kumkanillam / controllers.application.js
Created May 23, 2016 08:39
Refresh Route On Update Store Record
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import DS from 'ember-data';
export default DS.RESTAdapter;
@kumkanillam
kumkanillam / controllers.application.js
Created May 24, 2016 11:00
Ember Set TwoDimensional Array
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
matchingArray: [
[{
"property": 'pathname',
"variable": null,
"equal": true,
"operator": 'equals',
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@kumkanillam
kumkanillam / components.select-demo.js
Last active May 26, 2016 06:31
Ember view Select
import Ember from 'ember';
export default Ember.Component.extend({
max_attemptintervalvalue:[1,2,3,4,5],
max_attempt_disabled:false,
attempt_countvalue:[1,2,3,4],
selectedVal:3,
selectedCountVal:1,
didInsertElement(){
this._super(...arguments);