2

What is the best way to pass arguments between controllers in Angularjs? I am using the $rootscope to broadcast arguments but it doesn't seem to be the most efficient.

1
  • you can also use service which is a singleton in angularjs Commented Sep 15, 2017 at 1:07

1 Answer 1

1

The best way to share data between controllers is with a Service.

It's described well in this answer https://stackoverflow.com/a/20181543/2503944

That answer uses a service to share products between controllers. You can apply that to whatever you need to share between yours.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.