AngularJS project to call RESTful service part 2
Using ang-starter to create sample AngularJS app. The structure is easily understandable and is using a later version of angular.
Modified the js/Controllers/ContactCtrl.js, calling the RESTful service using $http.
TODO: Change to use ‘ngResource’
Modified partials/contact.html to display the result using a simple table.
TODO: Change project to ‘Angular Material Design’
The ‘app’ directory is the deliverable, use apache to host the files. Add apache config settings to httpd.conf.
Use your browser to view results, open dev view, watch the console tab. You may encounter “no ‘access-control-allow-origin’ header is present on the requested resource” this means your RESTful resource is not allowing CORS. Enable this to springwebapp by adding a filter.
Specify the filter inside web.xml
Redeploy both springwebapp and angularjswebapp to see results. It should display list of contacts when you click on the contact tab.
Comments