I have a scenario where I have a component which does some http
requests to show data and if there is an exception while doing so, I want to show instead just the error component.
Does it make sense to have the error component already on the template as
<ng-template [ngIf]="showError">
<error-view></error-view>
</ng-template>
and set the flag to true to show.
Or inject the component dynamically using ComponentFactoryResolver
once there is error?