Hi,

lets say i want to wrap this: http://justgage.com/ in a angular component
so i create a nice directive:

.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>'

};
})

that childid will print: {{markupId}}

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.

johan


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to