Skip to content

Instantly share code, notes, and snippets.

1. LoadingScreenComponent
import { Subscription } from 'rxjs';
import { Component, OnInit, OnDestroy, Output, EventEmitter, Input } from '@angular/core';
import { LoadingScreenService } from '../../services/loading-screen.service';
import { debounceTime } from 'rxjs/operators';
@Component({
selector: 'loading-screen',
@ZhenDeng
ZhenDeng / 2
Last active August 5, 2022 06:32
Hope you all are doing good!!
After 3 years of exciting and memorable journey with TCS-CBA and almost 9 years with TCS, it is time to move on to explore something new and embark on new opportunities & challenges in my life. Monday (8th Aug) is my last working day at TCS and CBA. While I’m excited about the new opportunity, leaving great working relationships like this one is definitely sad.
Throughout my years with CBA, I have worked with the amazing people, I am taking with me a wealth of learning and experience as well as cherish some very good memories of the past that we have worked together. My sincere gratitude to all my TCS and CBA colleagues, mentors and leaders who were with me in this journey; who trusted me, encouraged me and always had my back. 
While I am excited about my next adventure, I will be missing all the wonderful talented friends I have worked with. The world is small enough and hopefully, we will meet again.
Wishing you all the best in your future endeavours.
1. in startup.cs
services.AddSingleton<IFileProvider>(
new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")));
2. in controller
#region Upload Users
[HttpPost("UploadUsers"), DisableRequestSizeLimit]
:host ::ng-deep .mat-radio-container{
height: 10px;
width: 10px;
}
:host ::ng-deep .mat-radio-outer-circle{
height: 10px;
width: 10px;
}
:host ::ng-deep .mat-radio-inner-circle{
height: 10px;
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("<div style='padding: 0; margin: 0; width:100%; height: 100%; background:#fbfaf7;'>");
stringBuilder.Append("<table width='100%' height='100%' align='center' cellspacing='0' cellpadding='0' bgcolor='#fbfaf7'>");
stringBuilder.Append("<tbody>");
stringBuilder.Append("<tr><td style='font:12px/1.5 Arial,Helvetica,sans-serif;color:#454545'>&nbsp;</td></tr>");
stringBuilder.Append("<tr>");
stringBuilder.Append("<td style='color:#343731;'><table width='600px' bgcolor='#ffffff' cellspacing='0' cellpadding='0' align='center' border='0' style='border:1px solid #232323;text-align:center'><tbody><tr><td style='padding:10px;color:#343731'>");
stringBuilder.Append("<h2 style='font-weight:400;text-transform:uppercase'>Trojan Trading Company PTY LTD</h2>");
stringBuilder.Append("</td></tr>");
stringBuilder.Append("<tr style='text-align:left'><td style='font:12px/1.5 Arial,Helvetica,sans-serif;color:#454545'><table width='90%'><tbody>");
in component
//unsubscribe
ngUnsubscribe: Subject<void> = new Subject<void>();
this.adminService.GetUserByAccount(_.toNumber(this.shareService.readCookie("userId"))).takeUntil(this.ngUnsubscribe).subscribe()
ngOnDestroy() {
this.ngUnsubscribe.next();
this.ngUnsubscribe.complete();
/*HTML*/
<button class="close-button" (click)="onNoClick()">
<span aria-hidden="true">&times;</span>
</button>
<div mat-dialog-title>
<div class="modal-header">
<h6 class="modal-title">Air freight terms</h6>
</div>
<div class="modal-body">
import { HttpInterceptor, HttpRequest, HttpEvent, HttpHandler, HttpParams, HttpParameterCodec } from "@angular/common/http";
import { Injectable } from "@angular/core";
import { Observable } from "rxjs";
@Injectable()
export class EncodeHttpParamsInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const params = new HttpParams({encoder: new CustomEncoder(), fromString: req.params.toString()});
return next.handle(req.clone({params}));
}
in HTM:
<span #popover="ngbPopover" id="downloadButton" placement="bottom" [ngbPopover]="popContent"
triggers="manual" (click)="openPop();"
[ngClass]="{'active-icon' : iconCanbeActive, 'default-icon': !iconCanbeActive }"></span>
in component:
@ViewChild('popover') public popover: NgbPopover;
import { set } from 'lodash';
set(NgbPopover.prototype, '_unregisterListenersFn', function() {});