January 2016
Intermediate to advanced
240 pages
7h 36m
English
To start using Angular with Rails, we mostly just need to install Angular using Bower, and arrange for Angular’s code to be served up by the asset pipeline. First, we’ll add Angular to Bowerfile.
| | asset 'bootstrap-sass-official' |
| | # START_HIGHLIGHT |
| | # END_HIGHLIGHT |
| | asset 'angular', '~> 1.5' |
| | resolution 'angular', '1.5' |
Note the use of the resolution keyword. Bower isn’t as sophisticated as Bundler at handling dependencies, and when it isn’t 100% sure what version of something to grab, it asks you, interactively. This is somewhat inconvenient, so you can specify a specific version to use for a specific asset. In this case, it does look confusing, because we really only have ...
Read now
Unlock full access