You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A generator for AngularJS, integrated with an Express `server.js` for full stack development. Featuring livereload of client and server files, grunt tasks that are integrated with express, and an easy deployment workflow.
4
4
5
-
Based on [angular-seed](https://github.com/angular/angular-seed/)
5
+
Based on [generator-angular](https://github.com/yeoman/generator-angular)
6
6
7
7
8
8
## Usage
9
9
10
-
Install `generator-angular`:
10
+
Install `generator-angular-fullstack`:
11
11
```
12
-
npm install -g generator-angular
12
+
npm install -g generator-angular-fullstack
13
13
```
14
14
15
15
Make a new directory, and `cd` into it:
16
16
```
17
17
mkdir my-new-project && cd $_
18
18
```
19
19
20
-
Run `yo angular`, optionally passing an app name:
20
+
Run `yo angular-fullstack`, optionally passing an app name:
21
21
```
22
-
yo angular [app-name]
22
+
yo angular-fullstack [app-name]
23
23
```
24
24
25
+
### Express
26
+
27
+
Launch your express server in development mode.
28
+
```
29
+
grunt server
30
+
```
31
+
32
+
Launch your express server in production mode, uses the minified/optimized production app folder.
33
+
```
34
+
grunt server:dist
35
+
```
36
+
37
+
### Livereload
38
+
39
+
`grunt server` will watch client files in `app/`, and server files inside `lib/`, restarting the Express server when a change is detected. This requires the [Livereload plugin](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) or equivalant to refresh your browser. Be sure that the plugin is enabled on the page you're testing.
40
+
41
+
### Deployment
42
+
43
+
While deployment should be easy enough with the `grunt dist` build, we provide an extremely simplifed deployment process for heroku.
44
+
45
+
`yo angular-fullstack:deploy heroku` for generating a deployment ready folder for [heroku.com](http://heroku.com/) from your project files.
46
+
47
+
**Create and Deploy an app in 4 steps**
48
+
49
+
1.`mkdir foo && cd foo`
50
+
51
+
2.`yo angular-fullstack`
52
+
53
+
3.`yo angular-fullstack:deploy heroku`
54
+
55
+
4.`cd heroku && git push heroku master`
56
+
57
+
That's it! Your app should be live and shareable. Type `heroku open` to view it.
**Note: Generators are to be run from the root directory of your app.**
43
78
@@ -46,15 +81,23 @@ Sets up a new AngularJS app, generating all the boilerplate you need to get star
46
81
47
82
Example:
48
83
```bash
49
-
yo angular
84
+
yo angular-fullstack
85
+
```
86
+
87
+
### Deploy
88
+
Initalizes a heroku app and generates a `heroku` folder which is ready to push to heroku.
89
+
90
+
Example:
91
+
```bash
92
+
yo angular-fullstack:deploy heroku
50
93
```
51
94
52
95
### Route
53
96
Generates a controller and view, and configures a route in `app/scripts/app.js` connecting them.
54
97
55
98
Example:
56
99
```bash
57
-
yo angular:route myroute
100
+
yo angular-fullstack:route myroute
58
101
```
59
102
60
103
Produces `app/scripts/controllers/myroute.js`:
@@ -74,7 +117,7 @@ Generates a controller in `app/scripts/controllers`.
74
117
75
118
Example:
76
119
```bash
77
-
yo angular:controller user
120
+
yo angular-fullstack:controller user
78
121
```
79
122
80
123
Produces `app/scripts/controllers/user.js`:
@@ -88,7 +131,7 @@ Generates a directive in `app/scripts/directives`.
88
131
89
132
Example:
90
133
```bash
91
-
yo angular:directive myDirective
134
+
yo angular-fullstack:directive myDirective
92
135
```
93
136
94
137
Produces `app/scripts/directives/myDirective.js`:
@@ -109,7 +152,7 @@ Generates a filter in `app/scripts/filters`.
109
152
110
153
Example:
111
154
```bash
112
-
yo angular:filter myFilter
155
+
yo angular-fullstack:filter myFilter
113
156
```
114
157
115
158
Produces `app/scripts/filters/myFilter.js`:
@@ -126,7 +169,7 @@ Generates an HTML view file in `app/views`.
126
169
127
170
Example:
128
171
```bash
129
-
yo angular:view user
172
+
yo angular-fullstack:view user
130
173
```
131
174
132
175
Produces `app/views/user.html`:
@@ -149,14 +192,14 @@ angular.module('myMod').service('myService', function () {
149
192
});
150
193
```
151
194
152
-
You can also do `yo angular:factory`, `yo angular:provider`, `yo angular:value`, and `yo angular:constant` for other types of services.
195
+
You can also do `yo angular-fullstack:factory`, `yo angular-fullstack:provider`, `yo angular-fullstack:value`, and `yo angular-fullstack:constant` for other types of services.
0 commit comments