The homepage of my angular app has several links to other pages, each of which requires a different resource (but all have the same controller). The home page controller has a function for choosing the next page, which decides which resource to load, and the other controller does manipulations on the resource (they all look the same, so the controller doesn't care) and sends it to the view.
I'd like to have a system where once the user makes a choice as to where to go from the home page, the resource is loaded for that session unless the user explicitly says to unload it. I have a MyResource service that implements initialize and get functions. The controller for the first page calls initialize(option), and the controller for the second page just should just call get when the page is hit. However, when the home page is hit the second controller is instantiated immediately, calls get, and can't find the resource because the user hasn't yet chosen which to load. How do I make the second controller wait to call get until the partial it belongs to is actually hit?