this.carriers = this.carriers.filter((el, i, a) => i === a.indexOf(el))
<form (submit)="showReport()">
<div class="form-group">
<label>Filter </label>
<input type="text" name="filter" class="form-control" [(ngModel)]="filter.keyword" />
</div>
<div class="text-right">
<button type="submit" name="search" class="btn btn-primary">Search </button>
</div>
</form>
Format: {{cost | currency:'USD':true:'1.2-2'}}
Output: $348.64
- Format: {{currency:currencyCode:symbolDisplay:digitInfo}}
- CurrencyCode Info: https://en.wikipedia.org/wiki/ISO_4217
- SymbolDisplay: is a boolean indicating whether to use the currency symbol or code.
true: use symbol (e.g. $).
false(default): use code (e.g. USD). - DigitInfo Format: {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
- 1 : minIntegerDigits
- 2 : minFractionDigits
- 2 : maxFractionDigits
Format: {{value | number : '1.2-2'}}
output: 250.12
Format: {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
1 : minIntegerDigits
2 : minFractionDigits
2 : maxFractionDigits
Use an extension method to convert from string to enum.
public static T ToEnum(this string enumString)
{
return (T) Enum.Parse(typeof (T), enumString);
}
//Usage:
Color colorEnum = "Red".ToEnum<Color>();
atob(): Decodes a string of data which has been encoded using base-64 encoding.
btoa(): Creates a base-64 encoded ASCII string from a "string" of binary data.
The "Unicode Problem": In most browsers, calling btoa() on a Unicode string will cause a Character Out Of Range exception. This paragraph shows some solutions.
Solution to unicode
btoa(): Creates a base-64 encoded ASCII string from a "string" of binary data.
The "Unicode Problem": In most browsers, calling btoa() on a Unicode string will cause a Character Out Of Range exception. This paragraph shows some solutions.
Solution to unicode