- cmp(cmpName: string, optional?: boolean): ((target: any, memberName: string) => void)
-
Parameters
-
cmpName: string
-
optional: boolean = false
Returns ((target: any, memberName: string) => void)
-
- (target: any, memberName: string): void
-
Parameters
-
target: any
-
memberName: string
Returns void
Reference to another component of the same entity.
If not optional it is required that the entity is part of the entity and if not optional, that it is in the order before this component.
Optional components that aren't present will be set to null.
Replaces:
With:
```ts @cmp('OtherCmp1') private other1:OtherCmp1;
@cmp('OtherCmp2', true) private otherCmp2?:OtherCmp2;