New to angular but loving it..
I have multiple directives and each of their link functions requires that the DOJO library is finished loading. Alas, I have to use DOJO.
So, as you can see in the code below I use dojo.ready() to run the link function once the library is loaded. However, this only works for the first directly to be linked. The second one never gets the ready event.
What is the right way to ensure that third party library initialization is complete before Angular starts running
Thanks for the help
<html>
<body>
<div d1 id="map">
<div d2></div>
</div>
<script src="app/js/app.js"></script>
</body>
</html>
app.js
=====================
angular.module("app").directive(
"d1",
function () {
return {
link: function (scope, element, attributes) {
function init() {
dojo.doStuff();
};
dojo.ready(init);
}
};
}
);
angular.module("app").directive(
"d2",
function () {
return {
link: function (scope, element, attributes) {
function init() {
dojo.doStuff();
};
dojo.ready(init);
}
};
}
);