Skip to content

Instantly share code, notes, and snippets.

@cloke
Created January 25, 2013 01:55
Show Gist options
  • Save cloke/4630972 to your computer and use it in GitHub Desktop.
Save cloke/4630972 to your computer and use it in GitHub Desktop.
#= require_tree .
window.App = App = Ember.Application.create()
App.Models = {}
App.Views = {}
# Models
DS.Adapter.configure 'plurals',
sticky: 'stickies'
App.store = DS.Store.create
revision: 11
adapter: DS.RESTAdapter.create(bulkCommit: false)
# App.store.adapter.serializer.primaryKey = (type) -> '_id'
App.Router.map ->
# this.route("about", { path: "/about" });
# this.route("favorites", { path: "/favs" });
App.IndexRoute = Ember.Route.extend
setupController: (controller) ->
controller.set('title', "My App");
controller.set('content', )
App.Sticky = DS.Model.extend
title: DS.attr('string')
dueDate: DS.attr('date')
isDone: DS.attr('boolean')
App.StickiesView = Ember.View.extend
stickiesBinding: 'App.StickiesController.stickies'
App.StickesController = Ember.ArrayController.create
init: ->
content = @get('content')
content.addObject App.Sticky.createRecord({title: "Render Out to screen"})
content.addObject App.Sticky.createRecord({title: "Data binding"})
# console.log("App.StickesController.stickies: %o", App.StickesController.stickies)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment