blob: c89add4383fbf2a88b17021a22b7a86248be31f9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<div>
<input style="display: inline-block; width:350px;" list=delimiterOptions
placeholder="Izaberite ili ukucajte delimiter za .csv fajl" class="form-control" [(ngModel)]="delimiter"
(input)="update()">
<datalist id=delimiterOptions>
<option *ngFor="let option of delimiterOptions">{{option}}</option>
</datalist>
<label for="checkboxHeader">Da li .csv ima header?</label>
<input (input)="update()" [(ngModel)]="hasHeader" type="checkbox" value="" id="checkboxHeader" checked>
<br><br>
<input id="fileInput" class="form-control mb-5" type="file" class="upload" (change)="changeListener($event)" accept=".csv">
<table *ngIf="csvRecords.length > 0 && hasHeader" class="table table-bordered table-light mt-5">
<thead>
<tr>
<th *ngFor="let item of csvRecords[0]; let i = index">{{item}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let row of csvRecords | slice:1:11">
<td *ngFor="let col of row">{{col}}</td>
</tr>
</tbody>
</table>
<table *ngIf="csvRecords.length > 0 && !hasHeader" class="table table-bordered table-light mt-5">
<tbody>
<tr *ngFor="let row of csvRecords | slice:0:10">
<td *ngFor="let col of row">{{col}}</td>
</tr>
</tbody>
</table>
<div *ngIf="csvRecords.length > 0" id="info">
. . . <br>
{{rowsNumber}} x {{colsNumber}}
</div>
</div>
|