Answer the question
In order to leave comments, you need to log in
How to properly organize the use of the controller?
There are two pages - on one the list of elements is simply displayed, on the second - the list of elements is displayed in the admin panel and editing operations are performed. CRUD operations are performed through the use of the Resource service.
Is c t.z. correct? architecture of the application will make one controller for two views , in the first case only one method will be used - loading data, in the second all 4?
Answer the question
In order to leave comments, you need to log in
From a security point of view, I would rather separate the functional part - a separate user part, a separate admin part (at the module level).
And in the case when both modules use the same functionality (mainly services and directives, they can be entered into some common module + glued through gulp / grunt
If the admin part is used more as an editor functionality, then you can use one controller and one view (based on the role information, you can control the display of the necessary buttons / fields through the ng-if directives)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question