.directive('JustGage', function() {
return {
restrict: 'E',
scope: {
},
controller: function($scope, $element, $attrs) {
$scope.markupId = //something dynamic, uniek on the page.could also be given into the scope or attributes.
},
link: function(scope, element, attrs) {
console.log("childid: " + element[0].children[0].id)
scope.gauge = new JustGage({
id: element[0].id,
value: scope.model.value,
min: scope.model.min,
max: scope.model.max,
title: scope.model.title,
label: scope.model.label,
relativeGaugeSize: true,
donut: scope.model.donut
});
},
template: '<div id="{{markupId}}"></div>'
};
})
because i need to wait even 1 more digest cycle before i can do new JustGage (because only then that element has the right id)
How to fix this nicely? If you include 3th party libs that want to bind on an id. And if that id is dynamic what is the event/time to really know, ok now it is done, now you can do what you want.