This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// send text email | |
sendEmail({ | |
subject: "Hello, World!", | |
text: "This mail has been sent from the frontend", | |
to: "[email protected]" | |
}) | |
// send multipart text / html email | |
sendEmail({ | |
subject: "Hello, World!", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 = []; |