I am trying to write custom directive. This is a fork from an example by Andy Joslin.
Please see the code http://plnkr.co/edit/jXfr6P?p=preview
I could pass the selection method to the first child scope, but not further. I know ng-repeat create child scopes, and the original example updates the model correctly. But, not sure how to call the function.
Click on Apparel -> sel = Apparel ==> works
Click on Mens Shirts -> sel = Apparel ==> Not OK (needs to be Mens Shirts )
Click on Mens Special Shirts -> sel = Apparel ==> works Not OK (needs to be Mens Special Shirts)
...
Click on Boats -> sel = Boats ==> works