Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit eda00ce

Browse files
docs(tutorial): clarify bower usage
1 parent 8377e81 commit eda00ce

File tree

4 files changed

+58
-30
lines changed

4 files changed

+58
-30
lines changed

docs/content/tutorial/index.ngdoc

+31-8
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,7 @@ node --version
112112
</a>.
113113
</div>
114114

115-
To install bower:
116-
```
117-
npm install -g bower
118-
```
119-
120-
Once you have Node.js and Bower installed on your machine you can download the tool dependencies by running:
115+
Once you have Node.js installed on your machine you can download the tool dependencies by running:
121116

122117
```
123118
npm install
@@ -130,8 +125,14 @@ This command will download the following tools, into the `node_modules` director
130125
- [Karma][karma] - unit test runner
131126
- [Protractor][protractor] - end 2 end test runner
132127

133-
Running `npm install` will also automatically run `bower install`, which will download the Angular
134-
framework into the `bower_components` directory.
128+
Running `npm install` will also automatically use bower to download the Angular framework into the
129+
`bower_components` directory.
130+
131+
<div class="alert alert-info">
132+
Note the angular-phonecat project is setup to install and run these utilities via npm scripts.
133+
This means that you do not have to have any of these utilities installed globally on your system
134+
to follow the tutorial. See **Installing Helper Tools** below for more information.
135+
</div>
135136

136137
The project is preconfigured with a number of npm helper scripts to make it easy to run the common
137138
tasks that you will need while developing:
@@ -141,6 +142,28 @@ tasks that you will need while developing:
141142
- `npm run protractor` : run the Protractor end 2 end tests
142143
- `npm run update-webdriver` : install the drivers needed by Protractor
143144

145+
### Install Helper Tools (optional)
146+
147+
The Bower, Http-Server, Karma and Protractor modules are also executables, which can be installed
148+
globally and run directly from a terminal/command prompt. You don't need to do this to follow the
149+
tutorial, but if you decide you do want to run them directly, you can install these modules globally
150+
using, `sudo npm install -g ...`.
151+
152+
For instance to install the Bower command line executable you would do:
153+
154+
```
155+
sudo npm install -g bower
156+
```
157+
158+
*(Omit the sudo if running on Windows)*
159+
160+
Then you can run the bower tool directly, such as:
161+
162+
```
163+
bower install
164+
```
165+
166+
144167
### Running Development Web Server
145168

146169
While Angular applications are purely client-side code, and it is possible to open them in a web

docs/content/tutorial/step_07.ngdoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ We are using [Bower][bower] to install client side dependencies. This step upda
3434
"private": true,
3535
"dependencies": {
3636
"angular": "1.2.x",
37-
"angular-mocks": "~1.2.15",
37+
"angular-mocks": "~1.2.x",
3838
"bootstrap": "~3.1.1",
39-
"angular-route": "~1.2.15"
39+
"angular-route": "~1.2.x"
4040
}
4141
}
4242
```
4343

44-
The new dependency `"angular-route": "~1.2.15"` tells bower to install a version of the
45-
angular-route component that is compatible with version 1.2.15. We must tell bower to download
44+
The new dependency `"angular-route": "~1.2.x"` tells bower to install a version of the
45+
angular-route component that is compatible with version 1.2.x. We must tell bower to download
4646
and install this dependency.
4747

4848
If you have bower installed globally then you can run `bower install` but for this project we have

docs/content/tutorial/step_11.ngdoc

+11-9
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,27 @@ We are using [Bower][bower] to install client side dependencies. This step upda
3333
"private": true,
3434
"dependencies": {
3535
"angular": "1.2.x",
36-
"angular-mocks": "~1.2.15",
36+
"angular-mocks": "~1.2.x",
3737
"bootstrap": "~3.1.1",
38-
"angular-route": "~1.2.15",
39-
"angular-resource": "~1.2.15"
38+
"angular-route": "~1.2.x",
39+
"angular-resource": "~1.2.x"
4040
}
4141
}
4242
```
4343

44-
The new dependency `"angular-resource": "~1.2.15"` tells bower to install a version of the
45-
angular-resource component that is compatible with version 1.2.15. We must tell bower to download
46-
and install this dependency.
47-
48-
If you have bower installed globally then you can run `bower install` but for this project we have
49-
preconfigured npm to run bower install for us:
44+
The new dependency `"angular-resource": "~1.2.x"` tells bower to install a version of the
45+
angular-resource component that is compatible with version 1.2.x. We must ask bower to download
46+
and install this dependency. We can do this by running:
5047

5148
```
5249
npm install
5350
```
5451

52+
<div class="alert alert-info">
53+
If you have bower installed globally then you can run `bower install` but for this project we have
54+
preconfigured `npm install` to run bower for us.
55+
</div>
56+
5557

5658
## Template
5759

docs/content/tutorial/step_12.ngdoc

+12-9
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,33 @@ We are using [Bower][bower] to install client side dependencies. This step upda
3737
"private": true,
3838
"dependencies": {
3939
"angular": "1.2.x",
40-
"angular-mocks": "~1.2.15",
40+
"angular-mocks": "~1.2.x",
4141
"bootstrap": "~3.1.1",
42-
"angular-route": "~1.2.15",
43-
"angular-resource": "~1.2.15",
42+
"angular-route": "~1.2.x",
43+
"angular-resource": "~1.2.x",
4444
"jquery": "1.10.2",
45-
"angular-animate": "~1.2.15"
45+
"angular-animate": "~1.2.x"
4646
}
4747
}
4848
```
4949

50-
* `"angular-animate": "~1.2.15"` tells bower to install a version of the
51-
angular-animate component that is compatible with version 1.2.15.
50+
* `"angular-animate": "~1.2.x"` tells bower to install a version of the
51+
angular-animate component that is compatible with version 1.2.x.
5252
* `"jquery": "1.10.2"` tells bower to install the 1.1.2 version of JQuery. Note that this is not an
5353
Angular library, it is the standard JQuery library. We can use bower to install a wide range of 3rd
5454
party libraries.
5555

56-
We must tell bower to download and install these dependencies. If you have bower installed globally
57-
then you can run `bower install` but for this project we have preconfigured npm to run bower install
58-
for us:
56+
We must ask bower to download and install this dependency. We can do this by running:
5957

6058
```
6159
npm install
6260
```
6361

62+
<div class="alert alert-info">
63+
If you have bower installed globally then you can run `bower install` but for this project we have
64+
preconfigured `npm install` to run bower for us.
65+
</div>
66+
6467

6568
## How Animations work with `ngAnimate`
6669

0 commit comments

Comments
 (0)