Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- App = Ember.Application.create();
- //Data store
- App.Store = DS.Store.extend({
- revision:12,
- adapter:DS.RESTAdapter.extend({
- url:"http://localhost/book-store-restful-api/api"
- })
- });
- //routers
- App.Router.map(function(){
- this.resource('book');
- this.resource('admin');
- });
- App.BookRoute = Ember.Route.extend({
- model: function(){
- return App.Book.find();
- }
- });
- App.IndexRoute = Ember.Route.extend({
- redirect: function(){
- this.transitionTo('book');
- }
- });
- App.Book = DS.Model.extend({
- isbn: DS.attr('string'),
- title: DS.attr('string'),
- author: DS.attr('string'),
- pub: DS.attr('string'),
- year: DS.attr('string'),
- price: DS.attr('string')
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement