I guess it's a classic JavaScript and asynchronism issue, but I didn't get, how to solve it. I'm building a fronend with AngularJS. Later the date will be retrieved from an API, but now I'm simply read it from a local I guess it's a classic JavaScript and asynchron