My web application has several pages who have their own controller. Inside these pages I use directives who also have a controller. All controllers use the controllerAs syntax and they are all set as vm
. According to this article this should work. However, I'm having trouble making it work in combination with a directive. In this codepen I have reproduced a similar situation:
http://codepen.io/csteur/pen/LGEdLy
In this example the parent scope is also broken because of the nested directive. Can anyone explain why this happens or how this can be changed to make it work?