简体   繁体   中英

How to run AngularJS in eclipse kepler?

I'm new to Angularjs and i'm trying to run first angular program with Spring. I downloaded the code from here: http://javahonk.com/spring-mvc-angularjs-integration/ . Imported it as a maven project. Downloaded JSDT and AngualrJs plugin from eclipse marketplace but it's still not running. There is no error message. I'm running this on tomcat 7. What am I missing?

Any help would be appreciated?

I'm not a Eclipse user. so I have no idea for that. But you can use nodejs as a static server. it is explained here

1) Install nodejs for your OS

2) Run this command in a terminal (console)

> npm install http-server -g

3) Start server

> cd /path/to/your/project
> http-server -o --cors 

Now you can access your project from browser http://localhost:8080/yourfile.html

Work in Eclipse and just refresh page on browser to see changes.

If you are working on a Spring Application within Eclipse IDE , your best alternative would be to start you appliction using an embedded Application Server (Best I would recommand are Jetty or Tomcat if you ain't need EE level components). You can follow this link , which holds basic steps for adding a new Application Server within Eclipse IDE.

Once you have added a new application server, you can deploy your application in it then launch it and you should have your applcation reachable at http://localhost:8080/SpringMVCAngularJS .

A good alternative when using Maven as a build tool, is using an embedded AS plugin such as Tomcat7 Plugin or Jetty Plugin . This plugin will provide the ability to start your applcation using the Maven different goals (which does not require adding a new AS into Eclipse IDE). I've pushed a sample module based on the tutorial you mentioned. YOu can test the above described plugin as follows in a *nix shell (You may need to setup git if not already done):

git clone https://github.com/tmarwen/stackoverflow-showcase.git
cd stackoverflow-showcase/springmvc-angularjs
mvn tomcat7:run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM