share service data with two independent controllers using $ emit


I want to share my service data b/w two controllers and my controllers are independent. How can I achieve this?

Here is my service:

angular.module("myApp").service('emt', function($http,$rootScope)
    this.value1 = "";
    this.value2 = "";

Here is my first controller:

angular.module('myApp').controller('emitCtrl', function($scope,emt,$modal,$rootScope){

        //firing an event towords upword direction using emit.
        $rootScope.$emit('myEmitEvent', 'emt');  //  emt is the name of service.

        //modeal for show emit data
            alert("hello its emit !");
                templateUrl: '../../../view/emitPageModal.html',
                controller: 'myEventCtrl'



Here is my second controller:

angular.module('myApp').controller('myEventCtrl', function($scope,emt,$modalInstance,$rootScope){
    $scope.ok = function () {

    $scope.cancel = function () {

// for catching an  event raised by emit
$rootScope.$on('myEmitEvent', function (event, data) {
    // 'Some data'


Here is my modal:

<div class="modal-header" ng-hide="demo">
    <h4>Modal Dialog</h4>
<div class="modal-body">
    <p>Example paragraph with some text.</p>

    <p>Your name is :{{user.value1}}</p>
    <p>Your number is :{{user.value2}}</p>
<div class="modal-footer">
    <button class="btn btn-success" ng-click="ok()">Okay</button>
    <button class="btn" ng-click="cancel()">Cancel</button>

Services are nothing but entities that can be shared. These can have complex objects, functions etc. In order to share them services has to return them like following :

      angular.module("myApp").service('emt', function($http, $rootScope) {
      var myObj = {
        value1: "",
        value2: ""
      var func = function(){
      return {
        obj: myObj,
        publicFun : func

Now the variable myObj will be available wherever emt is injected.

angular.module('myApp').controller('emitCtrl', function($scope,emt,$modal,$rootScope){

This emt.obj will always have the latest value in any controller it is shared in.