Angular JS – Simple and complete $q service example with promise

When you need to make a blocking call in Angular JS you may find the $q service handy. It’s built right into the base Angular framework, and will free up the browser when performing actions that can take some time.

Here is a complete, but simple example.

 

Idea intellij java server with AngularJs

*Before install nodejs and npm

Create a new Java Web Application in intellij

Edit the created index.jsp and set a title and some content

 

Add in a new runtime configuration to launch the web application in tomcat. (Make sure to add the war:exploded to deployment)

Start it up to insure your page is rendered.

Next step open the Terminal Tab of intellij

Finally add the angular/app folder to your deploy.

Select the web module facet in the module you have created and add the app folder to the /app path

restart the app server from intellij

head to localist:8080/app to run the angular seed part of the application.