Coder Social home page Coder Social logo

angular-for-rails-developers-issues's People

Contributors

jasonswett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

philipgil

angular-for-rails-developers-issues's Issues

Latest Angular CLI uses Webpack instead of SystemJS

ng serve

It seems like you're using a project generated using an old version of the Angular CLI.
The latest CLI now uses webpack and includes a lot of improvements, include a simpler
workflow, a faster build and smaller bundles.

To get more info, including a step-by-step guide to upgrade the CLI, follow this link:
https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.12_**

Switching to webpack seems like a big change. Is this something that will cause headaches later on, when version 1.0.0 of the CLI is completed? Has anyone tried the upgrade instructions on the author_wizard app? Do they work?

Failed to detect set buildpack

I must say its been really turbulent since i started following. Im running windows 8 on macbook pro. Right now i am stuck in page 8 git push heroku master. I get the error : failed to detect set buildpack https://github.com/jasonswett/heroku-buildpack-nodejs.

I feel that i must equally mention what i have experienced before i got here

  1. I had to manually install postgre because i do not have it installed before. Then configured my environment.yml file to use it
  2. ln -s on windows gives access denied so i had to use mklink /d to achieve the same purpose
  3. Since i modified the package.json file, the web browser do not display 'app-works' any longer
  4. Arriving at page 8 to execute git push heroku master gave an error saying no remote repository. Therefore i had to creat a github folder, to follow with the rituals of git init, remote add, commit and git push. Before finally doing git push heroku master

Suggestion: Add a combined diff like view

A combined diff like view where the additions are picked out in, for example, green, would be especially helpful on pages 20 (spec/rails_helper.rb) and 22, and 23.

Suggestion: Show block folding, and/or tabs/spaces

It would be a lot easier to follow the longer code blocks if block folding were illustrated somehow.

I had a slight issue with the reference code for spec/controllers/book_controller_spec.rb, with it spanning three pages, and with the multiple edits required, I deleted an end and took some time to find where it was missing.

Line numbers would be nice too, something like this:

code-folding

If not block folding, how about showing tabs or spaces:

show-invisbles

Page 62: Integration tests fail

I can’t get the integration test introduced in Adding Integration Tests to work without modification.

This is the error message reported:

Failures:

  1) Books list page
     Failure/Error: raise ActionController::RoutingError, "No route matches [#{env[ 'REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"

     ActionController::RoutingError:
       No route matches [GET] "/ember-cli-live-reload.js"

[…]

     # --- Caused by: ---
     # Capybara::ExpectationNotMet:
     #   expected to find text "Books" in "Loading..."

[…]

Before:

# spec/features/books_spec.rb

require 'rails_helper'

feature 'Books', js: true do
  scenario 'list page' do
    visit '/'
    expect(page).to have_content('Books')
  end
end

And here’s the spec after I modified it:

require 'rails_helper'
Capybara.raise_server_errors = false

feature 'Book', js: true do
  scenario 'list page' do
    visit '/'
    sleep 5.second # !important
    expect(page).to have_content('Book')
  end
end

If I leave out the Capybara.raise_server_errors = false, then the RoutingErrors still appear. If I leave out the sleep 5.second, then the browser window pops open and closes before the page has loaded.

Pushed to Heroku, but app isn’t up to date

I’ve finished the book, committed the change locally and ran git remote show heroku, but the Heroku application isn’t up to date. Any ideas why?

I’ve tried rebooting the app (through the Heroku web dashboard, Overview → More → Restart all dynos) and heroku ps:restart.

The Heroku repository reports it’s up to date:

# git remote show heroku
* remote heroku
  Fetch URL: https://git.heroku.com/secure-depths-61266.git
  Push  URL: https://git.heroku.com/secure-depths-61266.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local ref configured for 'git push':
    master pushes to master (up to date)

And:

# git ls-remote heroku
11ac8180b8748fbd4f50e955c791f209eaa74400    HEAD
11ac8180b8748fbd4f50e955c791f209eaa74400    refs/heads/master

And the Heroku app: https://secure-depths-61266.herokuapp.com

And I check back a few hours later and it’s up-to-date with my local git repository. Any idea why there would be a lag between push and updating? Is there some kind of caching going on? (I really should have tried in a different browser, this was all observed using Google Chrome.)

Deploying to Heroku not successful- Node wouldn't compile

I've worked through errors in the heroku deployment, but now Im not sure what the issue is.
http://stackoverflow.com/questions/40208635/angular-for-rails-developers-book-deploying-angular-on-rails-on-heroku

Push rejected, failed to compile Node.js app.

https://github.com/theresaluu/tut-angular-for-rails-developers

I previously had an issue with my package.json because it was missing a comma, but I addressed that . Any help would be appreciated.

Update 'dist' to 'src'

This is meaningful because when Angular CLI serves our Angular app locally, the way it does that is by running the ng build command which generates a dist directory. Inside that dist directory is everything that's needed to run our Angular app, including an index.html which, if visited, will kick off everything else that's needed to pull up the app.

Should be

This is meaningful because when Angular CLI serves our Angular app locally, the way it does that is by running the ng build command which generates a src directory. Inside that src directory is everything that's needed to run our Angular app, including an index.html which, if visited, will kick off everything else that's needed to pull up the app.

Page 31: Serving JSON up to Firefox

The Problem

Firefox has a problem with correctly receiving the JSON formatted data, the issue is caused by the request headers that it sends along. The default:
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"

Google Chrome by contrast sends this request header, which accepts anything:

Accept: */*

So, if you’re using Firefox, when you get to this point in the book, where the list of books is expected, nothing appears. Nothing appears because ng server has sent back the main index.html instead of the desired JSON in response, viewing Firefox’s developer tools console shows this error:

EXCEPTION: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

(The first and unexpected character is the first character <.)

The Fix

One way to fix this is to change the Header sent with the http.get.

Before:

// src/app/book-list/book-list.component.ts
[…]
import { Http } from '@angular/http';
[…]

  ngOnInit() {
    this.http.get('/api/books.json')
      .subscribe((response) => this.books = response.json());
  }

[…]

After:

// src/app/book-list/book-list.component.ts
[…]
import { Http, Headers } from '@angular/http';
[…]

  ngOnInit() {
    this.http.get('/api/books.json', { headers: new Headers({'Accept' : '*/*' }) })
      .subscribe((response) => this.books = response.json());
  }

[…]

Maybe there’s a better way? Maybe this will be fixed in Angular?
Source: angular/angular-cli#889

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.