This file contains 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
import { | |
Component, ElementRef, Input, OnInit, Renderer2 | |
} from '@angular/core'; | |
/** | |
* @whatItDoes Add show hide button to text/password input fields. | |
* | |
* @howToUse | |
* <show-hide-password size="sm|lg"> | |
* <input type="password" name=... /> |
This file contains 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
import { ChangeDetectorRef } from '@angular/core'; | |
/** | |
* @whatItDoes decorates Component with toggleOrder(property), get list() and get(CSS)Class functions. | |
* | |
* @howToUse | |
* \@Component({ | |
* template: ` | |
* <table> | |
* <tr> |
This file contains 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
import { Component, EventEmitter, Input, Output } from '@angular/core'; | |
import * as iso3166 from 'iso-3166-2/iso3166.min'; | |
@Component({ | |
selector: 'app-country-select', | |
template: ` | |
<select name="theme" [class]="'form-control' + (size ? ' form-control-' + size : '')" | |
[ngModel]="countryIsoCode" (ngModelChange)="change($event)"> | |
<option *ngFor="let country of countries" [ngValue]="country.value">{{country.display}}</option> |
This file contains 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
import { Directive, Renderer2, ElementRef, AfterViewInit } from '@angular/core' | |
@Directive({ | |
selector: '[inputWrapper]' | |
}) | |
export class InputWrapperDirective implements AfterViewInit { | |
constructor(private _renderer:Renderer2, private _el: ElementRef) { | |
} |
This file contains 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
<Directory "****"> | |
SetEnvIf Origin "^http(s)?://.+$" AccessControlAllowOrigin=$0 | |
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
Header always set Access-Control-Allow-Credentials true env=AccessControlAllowOrigin | |
Header always set Access-Control-Allow-Methods "HEAD, POST, GET, OPTIONS, DELETE, PUT" | |
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token" | |
</Directory> |
This file contains 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
import { Pipe, PipeTransform } from '@angular/core'; | |
import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser'; | |
@Pipe({ | |
name: 'safe' | |
}) | |
export class SafePipe implements PipeTransform { | |
constructor(protected sanitizer: DomSanitizer) {} | |
public transform(value: any, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl { |
This file contains 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
import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core'; | |
/* | |
*ngFor="let o of someArry | sortArray:'desc'" | |
*/ | |
@Pipe({ | |
name: 'sortArray', | |
}) | |
export class SortArrayPipe implements PipeTransform { | |
collator: Intl.Collator; |