# Passing bulk data between controllers

**URL:** <https://forum.ionicframework.com/t/passing-bulk-data-between-controllers/5770>\
**Category:** ionic-v1\
**Created:** [June 17, 2014, 11:59am UTC](https://forum.ionicframework.com/t/passing-bulk-data-between-controllers/5770 "2014-06-17T11:59:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrvamsidhar](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@mrvamsidhar](https://forum.ionicframework.com/u/mrvamsidhar)\
**Post date:** [June 17, 2014, 11:59am UTC](https://forum.ionicframework.com/t/passing-bulk-data-between-controllers/5770/1 "2014-06-17T11:59:13Z")

</div>

hi, I am having a requirement like below.

Lets say, there are tow pages in my app. 1 - Search Page 2. Display search results Page.  
When user enters some search criteria in Search page and click on “Search Button”. Then I should display data in Search results page. (Page 2). How my design should be?

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [June 17, 2014, 1:33pm UTC](https://forum.ionicframework.com/t/passing-bulk-data-between-controllers/5770/2 "2014-06-17T13:33:37Z")

</div>

You would want to use a factory to have access to the data between controllers. Take a look at our tabs or sidemenu starter apps, which have a factory set up for data.

---

<div class="post-metadata">

**Author:** ![sakotturi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sakotturi](https://forum.ionicframework.com/u/sakotturi)\
**Post date:** [February 16, 2015, 1:17am UTC](https://forum.ionicframework.com/t/passing-bulk-data-between-controllers/5770/3 "2015-02-16T01:17:13Z")

</div>

I’ve reviewed a number of docs and trying to figure out the best way of doing this.

The comments in the tab starter project factories mention “// Might use a resource here that returns a JSON array”

But I can’t find any good instructions for how to implement a resource that:

1. allows for sharing of state ie. data between two controllers that utilize the factory
2. doesn’t make a new server call when switching views
3. implements the getters/setters practice
4. Handles the HTTP request within the factory and doesn’t offload to the view-controller (this seems to avoid the goal of sharing the data between two controllers/views).

In other words, exactly what the demo does but implementing a resource.

The [ionic learn on backend services](http://learn.ionicframework.com/formulas/backend-data/) doesnt do #1 or #4  
These tutorials on resources also don’t really complete the picture:  
[http://odetocode.com/blogs/scott/archive/2013/02/28/mapping-an-angular-resource-service-to-a-web-api.aspx](http://odetocode.com/blogs/scott/archive/2013/02/28/mapping-an-angular-resource-service-to-a-web-api.aspx)  
[https://docs.angularjs.org/tutorial/step\_11](https://docs.angularjs.org/tutorial/step_11)

Thanks in advance!  
Sante

---

<div class="post-metadata">

**Author:** ![mrvamsidhar](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@mrvamsidhar](https://forum.ionicframework.com/u/mrvamsidhar)\
**Post date:** [February 20, 2015, 7:47am UTC](https://forum.ionicframework.com/t/passing-bulk-data-between-controllers/5770/4 "2015-02-20T07:47:58Z")

</div>

To share data between controllers I am using services. These services are singleton and so we have no issues of maintaining state.

---

<div class="post-metadata">

**Author:** ![sakotturi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sakotturi](https://forum.ionicframework.com/u/sakotturi)\
**Post date:** [March 15, 2015, 8:40pm UTC](https://forum.ionicframework.com/t/passing-bulk-data-between-controllers/5770/5 "2015-03-15T20:40:01Z")

</div>

> [@mrvamsidhar](#):
>
> ionic learn on backend services

like [this](http://learn.ionicframework.com/formulas/sharing-data-between-views/) ionic tutorial ?  
I’ve been using this (and versions of this) and it’s been fantastic
