Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49228

Making a variable accessible across controllers and models

$
0
0

@claudiocarmeli wrote:

As soon as my app launches, I send a GET request to an API to get stuff and display it on screen. This code lives in my controller and it's really short.. a couple of lines. Now, I need that same stuff to be accessible from a service (another service, not the one linked to that controller). What is the best way to do this?
Should I do
$rootScope.name = 'Jules';
?
Or is there a better way?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49228

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>