What application structure to use with AngularJS and Laravel?

前端 未结 3 598
孤街浪徒
孤街浪徒 2020-12-13 02:21

I recently started to build a large social network, and and I thought my structure was good but it turned out I built this logic up badly.

I mixed my views with Angu

3条回答
  •  攒了一身酷
    2020-12-13 03:13

    To actually benefit from most of angular's features you should write a Single Page Application. This means you will communicate with the server through web APIs and you won't have any Laravel server-side templates.

    So yes, you should write two decoupled applications. One client-side, using Angular and one server-side that exposes a web API, preferably RESTful.

    This way you could switch from JS/HTML/CSS on the client side to Flash or Silverlight or something else and from Laravel/PHP/MySQL to .NET or NodeJS or Meteor/MongoDB.

提交回复
热议问题