I
I
igsavenko2016-01-30 20:02:22
Angular
igsavenko, 2016-01-30 20:02:22

What is the best approach to AngularJs development?

Good afternoon,
I always wanted to learn AngularJs and everything turned out to be not as easy as I thought. A very cool powerful library, there is so much documentation on it and it’s hard to get into everything at once. While writing the question, Toster gave me tips, found good advice and best practice. But I haven't found an answer to my question yet.
I am very familiar with Laravel (I have written more than one project with it), and then I decided to write a small project and at the same time learn angular.js.
I came across the very first article on the Internet at the request of Laraver + AngularJs. here is the link .
If it’s not difficult for you to look, please, I really liked this architecture at his approach to organizing the Controller and the Service. All logic is described in one controller (getting a list, creating, deleting, etc.), and access to data in the Service.
But on the official site angularjs.org I found an example - Wire up a Backend (right on the main page), what I wanted to do approximately (only other data) and here I don’t understand, a completely different approach to organizing. It is not clear why create a new controller for each action: ProjectListController, NewProjectController, EditProjectController... and then bind it to the route.
It just doesn’t fit in my head, I like the first approach more, but I still don’t know how to develop it to solve my problem, and the second one causes conflicting thoughts. Can someone explain? Many thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir T., 2016-01-31
@vachuahe

Angular is good at the start, but it is very easy to shoot yourself in the foot with its starting bonuses and have problems in the future. The guides from John Papa are good, but if the project has the potential for growth, then read this post teropa.info/blog/2015/10/18/refactoring-angular-ap... It's about how the codebase is written with a fever turn the joys of double binding into a maintainable and extensible one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question