There are two templates. In one we display the data, in the other we edit. We work with one $rootScope
. The whole difficulty is that the variable does not change, and the content changes. For example, $rootScope.profile.image = 'users/01/avatar.jpg'
$rootScope.profile.image
always for this user will be exactly that, but the image on the link can change not limited number of times. Googled, but did not find a working solution for me to update the contents of $rootScope
. How to fix it?
- Give your code to display and edit data. - Stepan Kasyanenko
- how to track $ rootScope change? - J. Doe
- Without an example of your code, we can not say anything. Even better, if you give a minimal, self-sufficient and reproducible example . - Stepan Kasyanenko
|
1 answer
Probably you have a problem not in $ rootScope. If you say that the $ rootScope.profile.image variable does not change what you want to update? If you have changed the image of the link (which is not a good practice), then you need to re-download it in the place where you use this link. This can be arranged by changing the link as follows:
$rootScope.profile.image = 'users/01/avatar.jpg?v=' + Date.now()
|