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 parentElement = document.querySelector('.parentElement') | |
const childElement = document.createElement('div') | |
document.querySelector('button').addEventListener('click', () => { | |
childElement.className = 'childElement' | |
if (parentElement.hasChildNodes()) { | |
document.querySelector('.parentElement').removeChild(document.querySelector('.childElement')) | |
} else { | |
parentElement.appendChild(childElement) | |
} | |
}) |
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
<ul> | |
<ng-container *ngTemplateOutlet="recursiveList; context: { list: dataSource.data }"></ng-container> | |
</ul> | |
<ng-template #recursiveList let-list="list"> | |
<li *ngFor="let item of list"> | |
<div *ngIf="item"> | |
{{ item | json }} | |
<span> | |
{{ item.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
const updatedFormValues = {}; | |
this.form['_forEachChild']((control, name) => { | |
if (control.dirty) { | |
updatedFormValue[name] = control.value; | |
} | |
}); |
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
"assets": [ | |
"src/favicon.ico", | |
"src/assets", | |
"src/web.config" | |
] |
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
<mat-list *ngIf="contracts"> | |
<mat-list-item *ngFor="let contract of contracts"> | |
<div class="row"> | |
<span *ngIf="!contract.toggle"> | |
{{ contractFunnel.name }} | |
</span> | |
<input matInput type="text" class="input" *ngIf="contract.toggle" [(ngModel)]="contract.name"> | |
<ng-template [ngIf]="!contract.toggle" [ngIfElse]="editContract"> | |
<mat-icon *ngIf="!contract.toggle" (click)="contract.toggle = true"> | |
edit |
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
export default function pickUpdatedProperties(current: any, sent: any) { | |
for (const key in current) { | |
if (current[key] && sent[key] && String(current[key]) === String(sent[key])) { | |
delete sent[key]; | |
} | |
} | |
return sent; | |
} |
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 { NgModule } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { ReportsComponent } from './reports.component'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
component: ReportsComponent, | |
children: [ | |
{ |
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 array = ["your", "response", "is", "here"]; | |
const interval = 1000; | |
array.forEach((el, index) => { | |
setTimeout(() => { | |
console.log(`Request ${index + 1}:`, el); | |
}, index * interval); | |
}); |
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
.your-class { | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: -webkit-box; | |
-webkit-box-orient: vertical; | |
-webkit-line-clamp: 3; /* number of max lines */ | |
} | |
/* https://stackoverflow.com/a/19049457 */ |
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
@mixin scrollbars($size, $foreground-color, $background-color: mix($foreground-color, white, 50%)) { | |
// For Google Chrome | |
&::-webkit-scrollbar { | |
width: $size; | |
height: $size; | |
} | |
&::-webkit-scrollbar-thumb { | |
background: $foreground-color; | |
} |
OlderNewer