I have a problem with using $ in constructor. ngOnInit() translate.instant etc. here is my code:
declare var $: any;
{
    var SelectedDevice = $("#select2-example-basic".val();
}
and here is what i got when I tried to run this code.
I do not know why I couldnt use $ in constructur ngOnInit Translate.instant etc. but it  works in other  functions , for instance: in  
onClick(){
    var infoDataTable = $('#basic-table').DataTable().page.info();
}
.. there is no error or fail...
and here is my html cod:
    <div class="table-responsive">
        <table id="basic-table" class="data-table table table-striped nowrap table-hover" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>{{'Plate'|translate}}</th>
                    <th>{{'Driver Name'|translate}}</th>
                    <th>{{'Start Time'|translate}}</th>
                    <th>{{'Starting Address'|translate}}</th>
                    <th>{{'End Time'|translate}}</th>
                    <th>{{'Ending Address'|translate}}</th>
                    <th>{{'Work Duration'|translate}}</th>
                    <th>{{'Distance'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let item of workDataReportList">
                    <td>{{item.Name}}</td>
                    <td>{{item.DriverName}}</td>
                    <td>{{item.StartTime | date:'dd.MM.yy hh:mm'}}</td>
                    <td>{{item.StartAddress}}</td>
                    <td>{{item.EndTime | date:'dd.MM.yy hh:mm'}}</td>
                    <td>{{item.EndAddress}}</td>
                    <td>{{item.RunningTime}}</td>
                    <td>{{item.Km | distance}}</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
I was wondering if it would be possible to help me about how can ı Use $ for this issues? thanks in advance...
for doing npm install @types/jquery I got this error:error is here
 
     
    