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
The Angular CLI can be used to generate new application scaffolding, as well as other things. It's a useful starting point, but you could at this point grab any existing Angular app and put it in the same place. We want to work with the Angular app in a subdirectory of `src/main`, just to keep the source code tidy and make it look like a regular Maven build.
104
+
The Angular CLI can be used to generate new application scaffolding, as well as other things. It's a useful starting point, but you could at this point grab any existing Angular app and put it in the same place. We want to work with the Angular app in the top level directory to keep all the tools and IDEs happy, but we also want make it look like a regular Maven build.
105
105
106
-
Create the app with the CLI and move it to `src/main`:
106
+
Create the app with the CLI and move it to the top level:
107
107
108
108
```
109
109
$ ./ng new client
110
110
$ rm -rf client/node* client/src/favicon.ico
111
-
$ mv client src/main
112
-
$ sed -i -e 's,dist,../../../target/classes/static,' src/main/client/.angular-cli.json
113
-
$ mv ng npm src/main/client
111
+
$ cat client/.gitignore >> gitignore
112
+
$ rm client/.gitignore
113
+
$ cp -rf client/* .
114
+
$ cp client/.??* .
115
+
$ sed -i -e 's,dist,target/classes/static,' .angular-cli.json
114
116
```
115
117
116
-
We discarded the node modules that the CLI installed because we want the frontend plugin to do that work for us in an automated build. We also edited the `.angular-cli.json` (a bit like a `pom.cxml` for the Angular CLI app) to point the output from the ANgular build to a location that will be packaged in our JAR file.
118
+
We discarded the node modules that the CLI installed because we want the frontend plugin to do that work for us in an automated build. We also edited the `.angular-cli.json` (a bit like a `pom.xml` for the Angular CLI app) to point the output from the ANgular build to a location that will be packaged in our JAR file.
[13:59:46] I/direct - Using ChromeDriver directly...
171
167
Jasmine started
@@ -199,7 +195,7 @@ then the client app will be compiled during the Maven build.
199
195
You can build continuously with
200
196
201
197
```
202
-
$ src/main/client/ng build --watch
198
+
$ ./ng build --watch
203
199
```
204
200
205
201
Updates are built (quickly) and pushed to `target/classes` where they can be picked up by Spring Boot. Your IDE might need to be tweaked to pick up the changes automatically (Spring Tool Suite does it out of the box).
@@ -237,7 +233,7 @@ With that in place your `Tasks->Run Task...` menu should include the `ng-watch`
237
233
You can add basic Twitter Bootstrap features to make the app look a bit less dull (taken from [this blog](https://medium.com/codingthesmartway-com-blog/using-bootstrap-with-angular-c83c3cee3f4a)):
0 commit comments