View Initial plugin in component
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; |
View encode decode string
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})); | |
} |
View Material terms and conditions template
/*HTML*/ | |
<button class="close-button" (click)="onNoClick()"> | |
<span aria-hidden="true">×</span> | |
</button> | |
<div mat-dialog-title> | |
<div class="modal-header"> | |
<h6 class="modal-title">Air freight terms</h6> | |
</div> | |
<div class="modal-body"> |
View cut connection if the app calling is obsolete
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(); |
View order confirmation template
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'> </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>"); |
View import excel to sql server
1. in startup.cs | |
services.AddSingleton<IFileProvider>( | |
new PhysicalFileProvider( | |
Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"))); | |
2. in controller | |
#region Upload Users | |
[HttpPost("UploadUsers"), DisableRequestSizeLimit] |
View change job
It’s been a fantastic eight years and eleven months, but it is time to move on. | |
Today is my last day at Dicker Data. I have enjoyed working for this company. It’s been a great place to work with a great bunch of people whose dedication and passion are second to none. I appreciate having had this wonderful opportunity to work with you all and I’m proud to have been part of the team. | |
I’d like to thank you all for your help and support and I will hold very fond memories of my time spent working with you, but for now I wish you the very best and every success in all the future endeavours from the bottom of my heart. | |
You can be in touch with me by email wardy.jm@gmail.com, mobile 0411 409 061 or find me on LinkedIn. I’d love to hear from you. | |
Take care and all the very best. |
View Loading screen
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', |
View Website loading remind
1. add html below in <app-root></app-root> or in index.html | |
<app-root> | |
<div id="pre-bootstrap"> | |
<div class="messaging"> | |
<h1> | |
Website is Loading | |
</h1> | |
<div class="app-loader"> | |
<div class="app-loader-inner"> |