How to share data between controllers in AngularJS ?

The task is to share data variable between two or more controllers by using AngularJS. There are many procedures to achieve this. Here we will discuss the most popular ones.

Approach: To share data between the controllers in AngularJS we have two main cases: