search

Home  >  Q&A  >  body text

angular.js - Are there any examples of using AngularJS and spring to separate front-end and back-end development? introduce

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?

PHPzPHPz2793 days ago798

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-15 16:53:49

    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
    1. This is the front-end directory structure, the folder is called webapp
    2. 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.

    reply
    0
  • Cancelreply