Is it still impossible to reference just a case?
I'm using some of Syncfusion's components within a form within modal and that modal within an ng-template.
So, same here accessing one of those components returns undefined.
And FormControl doesn't allow access to Syncfuions' component's functionalities.
I tried, ViewChild, ViewChildren, ElementRef, TemplateRef.. Yet nothing.
<ejs-dialog id="component-dialog" #Dialog>
<ng-template #content>
<form
id="formId"
[formGroup]="reactForm"
#formDir="ngForm"
class="form-horizontal"
novalidate=""
>
<div class="form-group">
<div class="e-float-input">
<ejs-datepicker
#datepicker
id="date_check"
formControlName="date_check"
name="date_check"
placeholder="Date of Birth"
floatLabelType="Always"
>
</ejs-datepicker>
<span class="e-float-line"></span>
<div *ngIf="date_check.errors">
<div
*ngIf="date_check.errors.date && date_check.touched"
class="e-error"
>
Please enter a valid date.
</div>
</div>
</div>
</div>
………………
</form>
</ng-template>
</ejs-dialog>
|
@ViewChild('datepicker', { static: false }) datepicker: DatePickerComponent;
ngAfterContentInit() {
setTimeout(() => {
if (this.datepicker == undefined) {
console.log(true);
} else {
console.log(false);
}
}, 5);
} |