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
1. in module provider | |
{ provide: APP_CONFIG, useValue: AppConfig } | |
2. app.config.ts | |
import { InjectionToken } from "@angular/core"; | |
import { IAuthConfig } from "../service/Authentication/auth.config"; | |
import { environment } from 'src/environments/environment'; |
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
1. Right Clicked on My Computer (windows) | |
2. Selected Advanced System Settings | |
3. Clicked "Environment Variables" | |
4. Under "Path" variable, made the FIRST value listed %AppData%\npm |
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
***Component: | |
import { ComponentCanDeactivate } from './pending-changes.guard'; | |
import { HostListener } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
export class MyComponent implements ComponentCanDeactivate { | |
// @HostListener allows us to also guard against browser refresh, close, etc. | |
@HostListener('window:beforeunload') | |
canDeactivate(): Observable<boolean> | boolean { |
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
ngAfterViewInit() { | |
setTimeout(() => { | |
}); | |
} |
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
Pipe File: | |
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'TableFilterMultiple' | |
}) | |
export class TablefilterMultiplePipe implements PipeTransform { | |
transform(items: any[], fields: any[], value: string): any[] { |
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
<html> | |
<head> | |
<style> | |
body { | |
font-family: 'Segoe UI' !important; | |
width: 900px; | |
margin: 0 auto; | |
background-color: #E7E6E3; | |
padding: 15px; |
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
Request.Headers.TryGetValue("some-header-name", out var headers); | |
if(headers.Count > 1 || string.IsNullOrWhiteSpace(headers.FirstOrDefault())){ | |
return new UnauthorizedResult(); | |
} |
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
HTML: | |
<ng-select class="customDropdwon" typeToSearchText="Please enter 3 or more characters" formControlName="txtAccountSearch" [items]="accountList" | |
bindLabel="accountName" [typeahead]="peopleInput$" bindValue="accountId" | |
placeholder="Search account by name or id *" [loading]="isLoading" (change)="accountSelected()"> | |
<ng-template ng-option-tmp let-item="item"> | |
<small>{{ item.accountName }}</small> | |
<small> | {{item.accountId}}</small> | |
</ng-template> | |
</ng-select> |
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, Inject, ViewChild } from '@angular/core'; | |
import { DOCUMENT } from '@angular/common'; | |
import { MatAutocompleteTrigger } from '@angular/material'; | |
@Component({ | |
... | |
template: ` | |
<input | |
autocomplete="address-level1" | |
(input)="onInput($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 { Directive, ElementRef, HostListener } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
@Directive({ | |
selector: '[routeTransformer]' | |
}) | |
export class RouteTransformerDirective { | |
constructor(private el: ElementRef, private router: Router) { } |