C
C
coderisimo2016-01-13 09:14:36
JavaScript
coderisimo, 2016-01-13 09:14:36

What is the best way to organize an application in Angular?

Wrote an application of 5 separate pages/views/controllers. 5-calculations.
Later, it became necessary to transfer everything to one page (instead of 5, as it was originally). I think it would be more elegant to organize everything.
Of course, everything can be lumped into one heap (one controller), instead of $scope.vatiable variables/methods of each of the 5 controllers can be put in its own scope of the $scope.controller1.variable type. (and so for all 5 controllers) thus I will insure against the intersection of names and I will have access to a common view from each piece of the transferred code. Maybe there are better ways?
With angular on "You", so there is no time to try complex things, but maybe there are simple and at the same time convenient?
I have a day for "everything about everything". The calculations are complicated, if something breaks, it will be very difficult to figure it out.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kostya Gorozhanov, 2016-01-13
@coderisimo

instead of doing $scope.controller1.variable like this. (and so for all 5 controllers), read about ng-controller="SettingsController as settings", so the logic will be in different controllers, but the view can be made one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question