Use Angularjs or Phalcon for frontend ?

Hi, I just know that many website are using Angularjs as frontend and PHP as backend. I wonder why ? Because as far as I know Angularjs is just javascript framework. If I use phalcon as backend, Which one is better for frontend? phalcon or Angularj (the difference, advantage and drawback?)

Thank you.



43.0k

You just use Phalcon on the backend to setup the environment that will then load Angular into the browser. I think that if you are asking the question like this that Angular is much too advanced for you to be learning at the same time that you are learning Phalcon. Angular is very difficult to start out with. Try starting Phalcon in the micro setup and learning about the dependency injector. By that time you will understand what Phalcon is and what it is not.

http://docs.phalconphp.com/en/latest/reference/micro.html

I am currently working on an internal enterprise web application in which we are using AngularJS and Phalcon. I am using Phalcon for the web service API and database access. AngularJS for the front-end. While I like AngularJS a lot it does begin to slow down greatly with large data sets. I worked around that with AJAX pagination and infinite scrolls. Using Phalcon to generate the page on the server would have shorten development time and optmized the front-end. "zaltanimb" is right look at http://docs.phalconphp.com/en/latest/reference/micro.html and http://docs.phalconphp.com/en/latest/reference/tutorial-rest.html for further details.



610

how can i setup angular with phalcon?

If you are making a big website, which needs to be SEO optimized i would recommend to use Phalcon's volt template engine. It will make your life much easier, because making angular pages indexable by search engines is additional effort and not a plesent task. If you do not care about SEO or the app is internal you could use angular.



43.0k

When using Volt and Angular together you will need to create a Volt function to be able to use {{ and }}: https://github.com/perchlayer/webird/blob/master/app/phalcon/config/volt%5compiler.php#L39



610

I am going to create a big project using phalcon and angular but having problem in config.and routes.



43.0k

Try my Webird project that loads up with a very basic Angular bootstrap example. I have it setup for Webpack. You might want to try a fork of the project where he went through and fixed a few issues.