Giter VIP home page Giter VIP logo

ember.js-in-action-source's Introduction

Ember.js-in-Action-Source

This is the code examples from Ember.js in Action. The code is split up into the following:

The code is split up into multiple parts. The complete source code is split up into multiple files and are linked up inside index.html. Where the chapters code is split into multiple major parts, each of these parts are included inside a single file containing the complete JavaScript code. The first part is names "app1.js", the second "app2.js" and so on. These files are linked up via their corresponsing "index1.html", "index2.html" and so on.

The code is structured in such a way that you are able to run the code example by simply opening the index.html file you want to run in your browser.

Note

Because the code uses console.log statements directly in the code, you need to enable the developer tools in order to view the code examples in Internet Explorer version 7 or 8.

ember.js-in-action-source's People

Contributors

joachimhs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember.js-in-action-source's Issues

Chapter 1 Delete note behavior not working as expected?

I'm trying to work through the notes example.

I'm having trouble with the delete note transition if the note being deleted is also the note being viewed.

When I download the example application, it seemed to be doing a transition regardless of what note is currently being viewed.

Then I noticed that if I cancel out of the modal, the note which I tried to delete has now become the selected note.

So is there something broken or misleading going on here?

Update the linkTo helper

With the latest build of emberjs, linkTo is deprecated, so its usage raises warnings to change to link-to.

Code Samples from Chapter 3 do not work either

I can't get the code samples working from chapter 3 either going by the book or downloading the examples.

So far I am regretting buying this book. It's the first book from Manning I've had a problem with. I realize it's a MEAP, but at this point I cannot recommend it to anyone else. The first 3 chapters are all coding examples and they do not work correctly.

Code Samples from Chapter 1-2 do not work completely

I tried copying the code samples from the book myself. For the Notes application, I found that it will store the notes and the note name but not the content of the note. As soon as you refresh, the notes are still there but any text stored in the body of the note is gone.

Looking at the console when you update a note, you can see that it is throwing an error every time you click the update button. My guess is that's where the problem is.

I thought maybe it was just me so I downloaded the code samples from Manning's site and confirmed that it has the same problem. Hopefully this will be fixed before publication.

Chapter 1

Example code just downloaded does not allow updates - error message "Cannot read property 'lookup' of undefined".. tried this with index.html and index4.html.

Sorry - replaced the ember data with a more recent version, and it's working now

Uncaught TypeError: Cannot read property 'lookup' of undefined

I noticed that starting with app3.js/index3.html, I observe the following error in the console when I hit the update button:

Uncaught TypeError: Cannot read property 'lookup' of undefined
DS.JSONSerializer.Ember.Object.extend.transformFor ember-data-beta-1.js:231
(anonymous function)      ember-data-beta-1.js:156
(anonymous function) ember-data-beta-1.js:3742
(anonymous function) ember-1.0.0.js:3172
OrderedSet.forEach ember-1.0.0.js:3015
Map.forEach ember-1.0.0.js:3170
DS.Model.reopenClass.eachAttribute ember-data-beta-1.js:3741
DS.Model.reopen.eachAttribute ember-data-beta-1.js:3756
DS.JSONSerializer.Ember.Object.extend.serialize ember-data-beta-1.js:152
DS.Model.Ember.Object.extend.toJSON ember-data-beta-1.js:3254
DS.LSAdapter.DS.Adapter.extend.updateRecord ember-data-localstorage.js:89
...

blogPosts JSON file not found

I'm not sure why, but it looks like jQuery is trying to look for the blogPosts JSON, and it's not finding it. I've mirrored my app structure to yours, but something's amiss. Here's a screenshot of my Chrome inspector.

You can check out my repo here. What am I doing wrong?

Update the source of the examples

Probably the LSAdapter should be included on the source codes as a separated js file: https://raw.github.com/rpflorence/ember-localstorage-adapter/master/localstorage_adapter.js

Even though the code examples here work, trying to replicate them from the latest version of emberjs will fail as the model will not be successfully parse. I researched and found that other adapters, other than the native fixture adapter, will have to be loaded.

This fixed my issues.

source: http://emberjs.com/guides/getting-started/using-other-adapters/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.