2015-12-31 08:46:32 +02:00
|
|
|
// #docregion
|
2016-11-10 14:04:35 +00:00
|
|
|
export const heroDetail = {
|
2015-12-31 08:46:32 +02:00
|
|
|
bindings: {
|
|
|
|
hero: '='
|
|
|
|
},
|
|
|
|
template: `
|
2016-04-11 15:36:53 +03:00
|
|
|
<h2>{{$ctrl.hero.name}}</h2>
|
2015-12-31 08:46:32 +02:00
|
|
|
<div>
|
|
|
|
<ng-transclude></ng-transclude>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
};
|
2016-11-12 15:27:51 +00:00
|
|
|
// #enddocregion
|
2016-11-10 14:04:35 +00:00
|
|
|
|
|
|
|
import { Directive, ElementRef, Injector, Input } from '@angular/core';
|
|
|
|
import { UpgradeComponent } from '@angular/upgrade/static';
|
|
|
|
import { Hero } from '../hero';
|
|
|
|
|
|
|
|
@Directive({
|
|
|
|
selector: 'hero-detail'
|
|
|
|
})
|
2016-11-10 15:27:45 +00:00
|
|
|
export class HeroDetailDirective extends UpgradeComponent {
|
2016-11-10 14:04:35 +00:00
|
|
|
@Input() hero: Hero;
|
|
|
|
|
|
|
|
constructor(elementRef: ElementRef, injector: Injector) {
|
|
|
|
super('heroDetail', elementRef, injector);
|
|
|
|
}
|
|
|
|
}
|