I have some data which come from serverside and cannnot be harcoded in js. I was thinking of rendering them as data attribute in HTML and get that back to angular javascript but cannot figure how to?
I've read this question in stack overflow which suggest to pull data through $http.get('serversideurl'). But I don't want to make another serverside request again.
Another suggestion was to put the data as global variable (eg somewhere in in window scope)
I would like to ask if it is possible to pull data directly from html data attribute, which I see convenient at the moment.
Is there any better way to do this? What approach is recommended?