View angular-material-autocomplete-async-part2-component.html
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn"> | |
<mat-option *ngIf="isLoading" class="is-loading"><mat-spinner diameter="50"></mat-spinner></mat-option> | |
<ng-container *ngIf="!isLoading"> | |
<mat-option *ngFor="let user of filteredUsers" [value]="user"> | |
<span>{{ user.name }}</span> | |
<small> | ID: {{user.id}}</small> | |
</mat-option> | |
</ng-container> | |
</mat-autocomplete> |
View email_dreamcode.js
// send text email | |
sendEmail({ | |
subject: "Hello, World!", | |
text: "This mail has been sent from the frontend", | |
to: "joe@exam.pl" | |
}) | |
// send multipart text / html email | |
sendEmail({ | |
subject: "Hello, World!", |
View gist:07d17ec05aeeee8544a19610486f2c6f
/** | |
* Sorting an array order by frequency of occurence in javascript | |
* @param {array} array An array to sort | |
* @returns {array} array of item order by frequency | |
**/ | |
function sortByFrequency(array) { | |
var frequency = {}; | |
var sortAble = []; | |
var newArr = []; |