angular.js - Are there any examples of using AngularJS and spring to separate front-end and back-end development? introduce
PHPz2017-05-15 16:51:49
0
1
776
Recently I am learning to use AngularJS in conjunction with back-end development. Can anyone who has used it introduce it or give a simple example to learn from?
The java side is completely deprecatedjsp改为开发api,返回jsondata
Then the view has a separate res folder to store the angular project. It is actually a pure front-end and can be placed anywhere and run across domains
Just negotiate the API between both ends
update
This is the front-end directory structure, the folder is called webapp
This is the directory under the backend main
About deployment
When deploying, you can directly create a war包发布就可以了吧,因为是前后端分离的,你部署可以只考虑后端啊,前端放在哪里应该都一样的,我这个是放在java项目下面,其实后端在远端服务器,这个webapp directory on the backend and put it on your own computer to solve cross-domain problems. It can also run because it has been separated
About running
If you want to access, you only need to access the front-end html page, because angular is obtained from the back-endjson数据,整体打包跑tomcat或者单独把webapp拿出来跑nginxIt should be fine
ps: I am not doing Java. This is a project that is not convenient for you. If you have any questions, you can continue to ask.
The java side is completely deprecated
jsp
改为开发api,返回json
dataThen the view has a separate res folder to store the angular project. It is actually a pure front-end and can be placed anywhere and run across domains
Just negotiate the API between both ends
When deploying, you can directly create a
war
包发布就可以了吧,因为是前后端分离的,你部署可以只考虑后端啊,前端放在哪里应该都一样的,我这个是放在java项目下面,其实后端在远端服务器,这个webapp
directory on the backend and put it on your own computer to solve cross-domain problems. It can also run because it has been separatedIf you want to access, you only need to access the front-end html page, because angular is obtained from the back-end
json
数据,整体打包跑tomcat
或者单独把webapp
拿出来跑nginx
It should be fineps: I am not doing Java. This is a project that is not convenient for you. If you have any questions, you can continue to ask.