>
> Heres some code so u could better understand the problem

 Heres the map directive controller code:
{
....
link: function(scope, element, attrs)
  {
  ..
    This function is being exectued asynchronously by this controller of 
the map directive, so the rest of the code of the this controller is being 
finished before this function finishes
    function InitLayer()
     {
         // THis code inits the layer 
     }

    // Here the function is being call async so the controller wont be 
stuck on this heavy init layer function (in the real code its a dojo 
require that does this async)
    CallFunctionAsync(InitLayer);


  .....
  }
...
}

Now in a different controller i want to call a function that puts a target 
on the map layer when that controller loads, the problem is that if the 
InitLayer function 
inside the map directive controller isnt finished an error is thrown 
because you just cant put targets on the layer before it is initialized.
Any ideas how can i call a function that will place the object on the map 
only when the Init layer inside the map directive (which is a different 
controller than
the one im in) has finished executing?

I tried using the $timeout service but with only half success (some cases 
it works, some it doesnt)

-- 
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/groups/opt_out.

Reply via email to