I have generated a simple angularJS project via AngularJS generator by yoeman
and after that created simple Spring-boot project with JPA repository which has one controller mehod with funcionality to select all users. The case is when I run both projects - spring on port 8080 and angular project on port 9000, there is no chance how the angular project can get to know about the data which spring is throwing.
My file tree in a project looks like:
And I think the problem is with index.html file. Normally it should be putted in a resource folder, so that spring project could communicate with angular project. But during grunt commend in cmd the build folder creates a new index.html file and the process makes circle. I thought about moving index.html file into resource folder but it doesn't make sense anymore.
I also thougt about changing the Gruntfile.js but honestly I don't know what excatly should I change. The Gruntfile looks like: Link to pastebin because the file was too long
Simple service:
angular.module('webappApp')
.factory('myroute', function ($resource) {
var service = $resource('/api/user', { id : '@id'},
{
});
return service;
});
Simple controller:
angular.module('webappApp')
.controller('MyrouteCtrl', function (myroute) {
console.log(myroute.query());
});

angular.module('webappApp') .factory('myroute', function ($resource) { var service = $resource('/api/user', { id : '@id'}, { }); return service; });Simple controller:angular.module('webappApp') .controller('MyrouteCtrl', function (myroute) { console.log(myroute.query()); });