I\'ve searched all over the internet and cannot find a solution please help!
directive(\'menu\',function(){ return{ link : function(scope,element
Delay the call to foo() using $evalAsync():
foo()
$evalAsync()
controller : function($scope){ $scope.$evalAsync(function() { $scope.foo(); console.log($scope); }); }
fiddle
You could also use $timeout() instead of $evalAsync(). Both allow the link function to execute first.
$timeout()