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
const gulp = require('gulp'); | |
const paths = gulp.paths; | |
const gulpIf = require('gulp-if'); | |
const $ = require('gulp-load-plugins')({ | |
pattern: ['gulp-*', 'del'] | |
}); | |
/** |
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
const Rx = require('rxjs'); | |
class AnimalsService { | |
constructor(data){ | |
this._source = data; | |
} | |
// lazy loading, client will ask for x items (limit) it will be the length of the returned array, | |
simplePager(pageIndex=0, limit=10, data) { | |
const deleteCount = pageIndex*limit; |
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
const zipit = (dest, name) => { | |
const filePath = path.join(dest, name + '.zip'); | |
const output = fs.createWriteStream(filePath); | |
const archive = archiver('zip', { zlib: { level: 9 } }); | |
archive.pipe(output); | |
// callback | |
output.on('close', () => { | |
console.log('callback when everything is finished'); | |
}); | |
archive.directory('deploy/', false); |
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
geSomethingById(id: number): Observable<any[]> { | |
return this.http.get<any[]>( | |
`api/something?id=${id}`); | |
} | |
getSomething(ids) { | |
const ids = this.getListOfVersionIds(selectedArtifacts) | |
const requests = ids.reduce((acc, id) => { | |
acc.push(this.geSomethingById(id)); |
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
import {Injectable, TemplateRef} from '@angular/core'; | |
import {MatDialog} from '@angular/material'; | |
import {ComponentType} from '@angular/cdk/typings/portal'; | |
import {MyDialogComponent} from './my-dialog.component'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class MyDialogService { | |
constructor(public dialog: MatDialog) { } |
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
import {Component, ComponentFactoryResolver, ComponentRef, Inject, OnDestroy, OnInit, ViewChild, ViewContainerRef} from '@angular/core'; | |
import {MAT_DIALOG_DATA} from '@angular/material'; | |
@Component({ | |
selector: 'app-my-dialog', | |
templateUrl: './my-dialog.component.html', | |
styleUrls: ['./my-dialog.component.scss'] | |
}) | |
export class MyDialogComponent implements OnInit, OnDestroy { | |
@ViewChild('target', { read: ViewContainerRef }) viewContainerRef: ViewContainerRef; |
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
<header> | |
<button mat-icon-button mat-dialog-close="true"> | |
<i class="material-icons">clear</i> | |
</button> | |
</header> | |
<mat-dialog-content> | |
<ng-template #target></ng-template> | |
</mat-dialog-content> |
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
import { Injectable } from '@angular/core'; | |
import { | |
HttpRequest, | |
HttpHandler, | |
HttpEvent, | |
HttpInterceptor, | |
HttpErrorResponse | |
} from '@angular/common/http'; | |
import { Observable } from 'rxjs'; | |
import {tap} from 'rxjs/operators'; |
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
<div (click)="isAdvancedOpen = !isAdvancedOpen"> | |
<i [ngClass]="[isAdvancedOpen ? 'fas fa-arrow-circle-down' : 'fas fa-arrow-circle-right']"> Advanced </i> | |
</div> | |
<app-tabs-advanced *ngIf="isAdvancedOpen" [somedatatobind]="somedatatobind"></app-tabs-advanced> |
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
// global style file | |
.alert-panel .mat-dialog-container { | |
border: 1px solid red; | |
} | |
// alert component | |
import {Component, Inject} from '@angular/core'; | |
import {MAT_DIALOG_DATA} from '@angular/material'; |
OlderNewer