title: Best way to pass data between a parent and popup page in angularjs
body: <p>I have a page from where I click a button and a popup page opens. I need a way to pass json data from my parent page to popup. These two are separate angular applications.</p>
  
  <p>The data is then modified based on user's actions and is submitted back to the parent page. I've looked at <a href="https://stackoverflow.com/questions/21519113/angularjs-open-a-new-browser-window-yet-still-retain-scope-and-controller-and">AngularJS: open a new browser window, yet still retain scope and controller, and services</a> which attaches the data to the $window object in parent page controller while opening the popup, assigning the data to the scope of the popup and then assigning the modified data in the popup to the $window.opener object in popup's controller so it's available in the parent.</p>
  
  <p>I was wondering if there is a angular way of accomplishing this by using services and passing data between the two pages/applications. </p>
  
  <p>I've looked at <a href="http://answer.techwikihow.com/27863/share-single-service-between-multiple-angular-js-apps.html" rel="nofollow noreferrer">http://answer.techwikihow.com/27863/share-single-service-between-multiple-angular-js-apps.html</a> which shows how to pass data between two ng-apps but I was wondering if there is a cleaner and straightforward solution than that. I don't want to refer to $window object in my popup's controller to access the shared data and then set the opener property. I want to be able to write a shared service which may/may not use $window object(preferably not) and pass data between parent and popup.</p>