I need to access to data with angularjs, as one would do with a simple static <div ng-init="data=['data']"/> in a context where the ng-init attribute has to be set from data coming from a cookie.
This pretty much should work, however, my partial making use of {{}} to access to data returns empty string.
I suspect it's a matter of race condition.
The simplified HTML code is as follows (the code is within a ng-controller):
<script>
var data = $.cookie("data");
$("#data").attr("ng-init", data);
</script>
<div> Data is '{{data}}'</div>