Encountering a peculiar conflict between two popular libraries within my Angular 4 project: ng-bootstrap
(ng-bootstrap) and Highcharts
(Highcharts).
The metering
component houses two child components: data-selection
and metering-chart
, structured like this:
<div>
<data-selection (selectedEntities)="onSelectedData()"></data-selection>
<button (click)="loadMeteringData()">Load Data</button>
<metering-chart *ngIf="chartData" [chartData]="chartData"></metering-chart>
</div>
The data-selection
component template includes the following -stripped- section:
[...]
<form class="form-inline">
<div class="form-group">
[...]
<div class="input-group">
<input class="form-control"
placeholder="yyyy-mm-dd"
name="dpStart"
[(ngModel)]="startDateModel"
ngbDatepicker
#startDate="ngbDatepicker">
<div class="input-group-addon"
(click)="startDate.toggle()">
<i class="fa fa-calendar"></i>
</div>
[...]
</div>
</div>
</form>
[...]
While the metering-chart
component contains:
<chart [options]="options"
(load)="createChartObject($event.context)"
(drilldown)="drilledDown($event)"
(drillup)="drilledUp($event)" style="width:100%; display: inline-block; "></chart>
The
metering
component is utilized as arouter-outlet
defined in aRoutes
file, which is then imported by aRoutingModule
. ThisRoutingModule
importsSharedModule
(where both child components:data-selection
andmetering-chart
are declared and exported), and is imported by the mainAppModule
.
Initially, when chartData
in metering
is undefined, the metering-chart
component remains hidden. During this state, the datepickers function properly.
However, upon clicking the button to load the chart's data and render it, the datepicker popups stop responding.
Attempts to recreate the issue in a plunker have been unsuccessful, but a gif showcasing the problem can be viewed here:
https://i.sstatic.net/ohUWJ.gif
It is observable that updating the model directly in the input field works, but selecting any dates from the popup does not trigger any action.
The following technologies are being used:
Angular v. 4.0.1
angular2-highcharts v. 0.5.5
ng-bootstrap v. 1.0.0-alpha.27
There is additional architectural and component interaction information available if needed, so please let me know if any crucial details are missing.