The @Template.directives should take full Binding support.
@Template({
url: '...',
directives: [
Directive1,
bind(Directive2).toClass(Directive2Impl),
]
})
UPDATE 1
The reason for this issue is something like this.
<tabs>
<pane></pane>
</tabs>
@Component({selector: 'tabs'})
class Tabs {}
@Component({selector: 'pane'})
class Pane {
constructor(tabs:Tabs) {}
}
Here Pane can inject Tabs. But what if you would like to write a different tab which participates is this. Imagine this.
<view-stack>
<pane></pane>
</view-stack>
@Component({selector: 'view-stack'})
class ViewStack extends Tabs {}
The above would not work even thought ViewStack implements Tabs.
So to fix this we would do this:
directives: [
Pane,
bind(Tabs).toClass(ViewStack),
]
And it would work as expected.
The
@Template.directivesshould take fullBindingsupport.UPDATE 1
The reason for this issue is something like this.
Here
Panecan injectTabs. But what if you would like to write a different tab which participates is this. Imagine this.The above would not work even thought
ViewStackimplementsTabs.So to fix this we would do this:
And it would work as expected.