Answer the question
In order to leave comments, you need to log in
How to dynamically include a directive?
Essence: there is a ProgressBar directive.
At the moment, it is connected to the parent component immediately and takes up space on the screen.
I would like to make this directive loaded only when the 'change' event occurs in the parent component on the input with type="file", i.e. as soon as one or more files are selected for upload. It is at that moment that it makes sense to display this directive.
Is there any way to do this without creating a new visibility property on the parent component and passing its value as an attribute?
<progress-bar [visibility]="visibility" [progress]="uploadProgress"></progress-bar>
Answer the question
In order to leave comments, you need to log in
нет, компонент вернхенго уровня должен же как-то это контролировать. И да, называться свойство должно хотя бы "uploadInProgress", что бы было понятно из контекста что это такое.
p.s. тут лучше подходит ngIf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question