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
.wrapper { | |
display: flex; | |
justify-content: space-between; | |
} |
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
<input class="tgl tgl-flip" id="cb5" type="checkbox" ng-model="vm.pattern.isPublic"> | |
<label class="tgl-btn" data-tg-off="Private" data-tg-on="Public" for="cb5"></label> |
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
<div> | |
<app-switch v-model="dataSwitch"></app-switch> | |
</div> |
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, HostListener } from '@angular/core'; | |
@Directive({ | |
selector: '[credit-card]' | |
}) | |
export class CreditCardDirective { | |
@HostListener('input', ['$event']) | |
onKeyDown(event: KeyboardEvent) { | |
const input = event.target as HTMLInputElement; |
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, HostListener, HostBinding } from '@angular/core'; | |
@Directive({ | |
selector: '[credit-card]' | |
}) | |
export class CreditCardDirective { | |
@HostBinding('style.border') | |
border: string; | |
@HostListener('input', ['$event']) |
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 } from '@angular/core'; | |
@Component({ | |
selector: 'form-component', | |
template: ` | |
<div> | |
<label> | |
Name | |
<input | |
name="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
function getImageType(arrayBuffer){ | |
var type = ""; | |
var dv = new DataView(arrayBuffer,0,5); | |
var nume1 = dv.getUint8(0,true); | |
var nume2 = dv.getUint8(1,true); | |
var hex = nume1.toString(16) + nume2.toString(16) ; | |
switch(hex){ | |
case "8950": | |
type = "image/png"; |
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
var copy = JSON.parse(JSON.stringify(tags)); |
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
constructor( | |
private componentFactoryResolver: ComponentFactoryResolver, | |
private appRef: ApplicationRef, | |
private injector: Injector | |
) { } | |
appendComponentToBody(component: any) { | |
// 1. Create a component reference from the component | |
const componentRef = this.componentFactoryResolver | |
.resolveComponentFactory(component) |
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
const hasValueValidator = (formGroup: FormGroup) => { | |
const hasValue = (val: string | string[]) => Array.isArray(val) ? val.length > 0 : !!val; | |
const formIsFilled = Object.values(formGroup.value).some(hasValue); | |
return formIsFilled ? null : { empty: true }; | |
} |
OlderNewer