0

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?

2
  • please can you post a sample code to analyse? Commented May 5, 2013 at 14:25
  • 1
    Probably not the best way to do it. As referenced by @pkozlowski.opensource you should really leave the $rootScope alone and use a service. Commented May 5, 2013 at 17:11

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.