Chadillac
Chadillac

Reputation: 429

How can I convert my web app to Angular 4 without Node.js/NPM

I currently am using java/html/css/js for my web app. I want to add Angular 4 into my webapp without using Node.js or NPM. Instead I would like to use Java.

Does anyone have any recommendations, examples, or ways I could go about doing this?

I imported the angular.min.js file into my project directory and added in some demo Angular code but it's not working. After running ng-build, I receive an error saying: "node_modules appears empty, you may need to run npm install"

Upvotes: 1

Views: 60

Answers (1)

Eric Ciminelli
Eric Ciminelli

Reputation: 76

Import the angular js file by downloading it into your project or referencing an angular CDN.

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>

Assuming you are using java servlets, create a new JSP with a controller endpoint mapped to it. Import the angular script on that JSP and you'll be good to go.

Upvotes: 1

Related Questions