Angularjs on a symfony2 application

前端 未结 15 1710
面向向阳花
面向向阳花 2020-12-12 09:55

I\'m working on a SF2 application that uses a lot of javascript on the front end.

SF2 provides me a good way of building a nice REST app, manage my database with doc

15条回答
  •  北海茫月
    2020-12-12 10:45

    I have come across the same situation where I had to develop a single page application using AngularJS on top of Symfony2.

    If you can separate the two apps, perfect!!! It would create a great separation of the Model and View layer. If not, as was the case with my application, you can surely use AngularJS with Symfony2 and TWIG perfectly fine.

    I used quotes around the AngularJS expressions like -

    {{ '{{someAngularJsExpression}}' }}
    

    It just takes some time to get used to it but when you do, you're not going to face many problems. Symfony also allows you to use other templating engines but I'd prefer not to.

    So my advice is to either have two different applications for AngularJS and Symfony. If you don't have the resources to do so, you can do the way I did. Don't worry, you'll get used to it.

提交回复
热议问题