From 595e5f9d32c9dda8f7b6c0dd5e7e4fba4693eca4 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 20 Mar 2013 17:08:14 +0100 Subject: basic Ember.js setup --- public/js/old-app.js | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 public/js/old-app.js (limited to 'public/js/old-app.js') diff --git a/public/js/old-app.js b/public/js/old-app.js new file mode 100644 index 0000000..7098e43 --- /dev/null +++ b/public/js/old-app.js @@ -0,0 +1,58 @@ +App = Ember.Application.create({ + LOG_TRANSITIONS: true +}); + +// App.Router.map(function() { +// this.resource("switchboards", { path: "/switchboards" }); +// }); + +// App.TablesRoute = Ember.Route.extend({ +// model: function() { +// return ; +// } +// }) + +// DS.RESTAdapter.configure("plurals", { +// switchboard_entry: "switchboard_entries" +// }); + + +App.Store = DS.Store.extend({ + adapter: 'DS.FixtureAdapter', + revision: 11 +}); + +App.Switchboard = DS.Model.extend({ + switchboard_entrys: DS.hasMany('App.SwitchboardEntry'), + name: DS.attr('string') +}); + +App.SwitchboardEntry = DS.Model.extend({ + name: DS.attr('string') +}); + +App.Router.map(function() { + this.resource('switchboard', { path: '/users/:user_id/switchboards/:switchboard_id' }); +}); + +App.SwitchboardsRoute = Ember.Route.extend({ + model: function(params) { + return App.Switchboard.find(params.switchboard_id); + } +}); + +App.Switchboard.FIXTURES = [{ + id: 1, + name: 'Erstes Ember Test Switchboard' +}, { + id: 2, + name: 'Zweites Switchboard' +}] + + +// var switchboard_view = Ember.View.create({ +// templateName: 'switchboard', +// name: "test" +// }); + +// switchboard_view.appendTo('#xxxyyy'); -- cgit v1.2.3