pineconellc/angular-foundation — pull request #125 by a-lucas (2014-10-09 02:50:48+00:00)
Title: Fix for  https://github.com/pineconellc/angular-foundation/issues/61

The issue https://github.com/pineconellc/angular-foundation/issues/61 is hard to replicate.

To replicate it, you need to have a very large page, with lots of data and controllers.
(I had this sisue with one page and 25 controllers who each inherits the same main profile controller )

On the directive init, attrs.active is true but unparsed.
The expression is complex and has to wait all the other controllers to initialize to get evaluated correctly.

getActive = $parse(attrs.active);

takes time to parse, but at the same time, the $watch is triggered.

This means the 'setActive' function is undefined in the $watch for this specific case where the $parse takes too long to eval.