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,
import Ember from 'ember';
export default Ember.Component.extend({
scrollingTimeout: 100,
bindScrolling: function() {
var self = this,
onScroll = function() {
Ember.run.debounce(self, self.runScrolled, self.scrollingTimeout);
};
import Ember from 'ember';
export default Ember.Component.extend({
scrollingTimeout: 100,
bindScrolling: function() {
var self = this,
onScroll = function() {
Ember.run.debounce(self, self.runScrolled, self.scrollingTimeout);
};
import Model from "ember-data/model";
import attr from "ember-data/attr";
import { belongsTo, hasMany } from "ember-data/relationships";
export default Model.extend({
invoices: hasMany(),
name: attr('string')
});
import Ember from 'ember';
export default Ember.Route.extend({
init() {
this._super(...arguments);
$.mockjax({
url: '/api/mock',
responseText: {
text: "someText"
@kumkanillam
kumkanillam / application.route.js
Created July 4, 2016 12:00 — forked from NullVoxPopuli/application.route.js
ember not recognizing plural type in payload
import Ember from 'ember';
export default Ember.Route.extend({
init() {
this._super(...arguments);
$.mockjax({
url: '/api/mock',
responseText: {
"data":
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement: function() {
// any JS inits that need to happen
// universally can be called here.
//
// For example if you need to register
// bootstrap dropdowns, you can do something
// like $('.dropdown-toggle').dropdown()