Stack Overflow Asked by Alice Messis on January 27, 2021
There is a structure directive:
@Directive({
selector: '[loading]',
})
export class LoadingDirective {
loadingFactory: ComponentFactory<LoadingComponent>;
loadingComponent: ComponentRef<LoadingComponent>;
@Input()
set loading(loading: boolean) {}
@Input('loadingSize') size: number;
}
I have tried to pass size:
<span *loading="true size=20"></span>
<span [loading]="true" [loadingSize]="20"></span>
Each input property stands on its own, and the *
is not necessary
EDIT
change
@Input()
set loading(loading: boolean) {}
to
@Input() loading: boolean;
otherwise you are not doing anything with the value, since your setter function is empty
Correct answer by PMO1948 on January 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP