I'm new to all Angular World, and i'm facing a problem managing the directives.
I'm working on a project that uses Tabs, and i want to extend its functionality to handle overflowed tabs when window size is narrower that the width of all my tabs, so i need to calculate some dimensions of elements to achieve this. The tabs are built from an Object in $scope, the problem is that the directive that calculates the dimensions is run before the view is fully compiled.
Plnkr Link: http://plnkr.co/edit/LOT4sZsNxnfmQ8zHymvw?p=preview
What i've tried:
- loading the template in directive using templateUrl
- working with transclude
- to use $last in ng-repeat
- try to reorder directive and create a dummy directive in every tab to trigger an event
I think that there is some AngularJs event, or property to handle this situation.
Please Guys Help :)
$timeoutyou are using? I have been using similar directive, and using0for delay, seems to give browser a chance to paint the DOM before code runs in directive - charlietfl