I have the following typscript.
it's supposed to randomize the quote that the user input
quoteReady: boolean = false;
randomizQuote(array);
{
this.quoteReady = true;
this.quote = array;
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
2.And this is what i put in the html and what i want to do is to take the randomized quote and put 2 to 3 lettres of it in each table
<section *ngIf="quoteReady">
<table class="table table-bordered table-hover table-responsive">
<thead>
<td>
<tr *ngFor="let quo of quote">{{ citation }}</tr> //i want to insert a
randome 2 to 3 //letters from the quote here
</td>
<td>
<tr *ngFor="let quo of quote">{{ array }}</tr>
</td>
<td>
<tr *ngFor="let quo of quote">{{ array }}</tr>
</td>
<td>
<tr *ngFor="let quo of quote">{{ array }}</tr>
</td>
<td>
<tr *ngFor="let quo of quote">{{ array }}</tr>
</td>
</thead>
</table>
</section>
So, I am not sure why this is not giving the output.