cannot create two directives on the same element with "scope"attributes and 'bindToController:true' #10888
Description
Hi,
I know that two directives cannot create a new isolated scope on the same element because of design principles (I understand and I think that such behaviour is correct).
In the Angular 1.3.X there is a new option in compiler which is bindToController:true which allows to bind attributes to the directive controller instead to the scope. In such case two directives with two different controllers can share the same scope but having its respectively attributes binded to each controller. Ex:
(In this case I have to use $attrs.$observe manually. )
What's the problem and so what I think that it can be improved: scope: { ... } is useful because it saves lot of code to syncronize and parse attributes (ex: '@' for $attrs.$observe, ...), and it is great to be reused to initialize controller attributes, but, the problem is that it also creates a new isolated scope (new and isolated), when in fact probably is not our objective (we have the controller encapsulating the state).
My proposal: if bindToController is true and scope: { ... } it does not creates a new isolated scope. In such case a new scope (but not isolated, ex scope: true, http://jsfiddle.net/drpicox/hozt6zrw/1/ ) should be the best option.