In an Angular.js app, I have a page with multiple inputs. There are multiple views (each of them render a small number of inputs) but only one Save button.
When the user want to save I need to collect all the changes and send them to the client.
The way I chose to implement it is by loading the initial content in the ng-app
main controller, and in each view I use $rootScope
as the data container (instead of $scope
).
This way I can access all the binded data from the parent controller to send it to the server.
Is it legal? Is there a nicer way implement it?