Sergey2015-03-17 04:22:32
Sergey, 2015-03-17 04:22:32

AngularJS SPA and Symfony2, pitfalls?

Good afternoon. For the sake of self-education / self-torture, I decided to develop a small reference application for my city for the time being. This should be my first application of this type. It can be difficult, but the more interesting / more difficult the task, the more skills I will acquire.
I sat for a while, read about what to use for development, and decided that I would use PhoneGap + AngularJS + Gulp + material desing\foundation ... I decided to give data in json form using Symfony2 (+ in the future I want to make a web version of the reference), most likely using FOSRestBundle? (other options?).
In general, from this moment a lot of questions arise, which is not strange for a beginner?) What modules for Angular do you recommend for working with json data ($http, ngResource, restangular), how best to organize receiving, processing, storing (localStorage?) data in angular (services? i.e. .factory), etc. etc. ). I would be very grateful for all sorts of links to useful resources on this topic. There are no deadlines, there is only a great desire to develop.
In general, I ask you to tell me what are the pitfalls that I will encounter out of ignorance during development.
PS forgive me if some of the questions were too stupid..

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Sergey, 2015-03-17

Check it out right away: https://github.com/johnpapa/angular-styleguide
How to write a REST Api is up to you. If it's more complicated and for self-study - look towards the jsonapi.org
standard draft As for modules - I personally don't like either ngResource or restangular (although this one is tolerable to use). For simple applications, any option is fine, but I like my wrapper over $http. But if there is no wrapper, it is better to take a ready-made solution. Any option will suit your needs.
Regarding services/factories - I recommend writing the application directly in ES6, then it will be possible to write normal services. In essence, the difference between services and factories is that a constructor function is passed to the first, a factory function is passed to the second. when using ES6 classes, writing services is much more convenient.
How to design an application - it will be difficult right away. There is a lot to read here, and not only in angular or symfony. For Symfony, the following things are suitable for example: https://github.com/phptodayorg/php-must-watch

Ilya Agarkov, 2015-03-17

If you want to do a bunch of PhoneGap + AngularJS, then look better towards ionic
Also, if this is a project for educational purposes, then maybe you should look towards Angular2 ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question