44024: simple search UI with decorator bug

This commit is contained in:
Lotte Hofstede
2017-08-18 14:23:06 +02:00
parent 4f6bc98979
commit 563cf6e820
30 changed files with 243 additions and 51 deletions

View File

@@ -0,0 +1,25 @@
import { Component, Input, Injector, ReflectiveInjector, OnInit } from '@angular/core';
import { ListableObject } from '../listable-object/listable-object.model';
import { getListElementFor } from '../list-element-decorator'
@Component({
selector: 'ds-wrapper-list-element',
styleUrls: ['./wrapper-list-element.component.scss'],
templateUrl: './wrapper-list-element.component.html'
})
export class WrapperListElementComponent implements OnInit {
@Input() object: ListableObject;
objectInjector: Injector;
constructor(private injector: Injector) {}
ngOnInit(): void {
this.objectInjector = ReflectiveInjector.resolveAndCreate(
[{provide: 'objectElementProvider', useFactory: () => ({ providedObject: this.object }) }], this.injector);
}
private getListElement(): string {
return getListElementFor(this.object.constructor).constructor.name;
}
}