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: | |
<input type="submit" class="btn btn-login register-submit" (click)="keyboardFocus(focusChange)" value="Stay on the page" #focusChange> | |
Component: | |
@ViewChild('focusChange') elChange: ElementRef; | |
setTimeout(() => { | |
this.elChange.nativeElement.focus(); |
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 | |
** Important: add tabindex="-1" to child tag | |
<button id="btn" class="btn" type="button"> | |
<span class="btn__content" tabindex="-1"> | |
I'm a button! | |
</span> | |
</button> | |
<a class="btn" href="#x"> | |
<span class="btn__content" tabindex="-1"> |
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
*** In app module providers | |
{ provide: MatSortHeaderIntl, useClass: CustomMatSortHeaderIntl } | |
*** custom-mat-sort-header-intl.ts | |
create custom-mat-sort-header-intl.ts and in the file: | |
import { Injectable } from '@angular/core'; | |
import { Subject } from 'rxjs/internal/Subject'; |
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
xcode-select --install |
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
sudo chown -R $USER /usr/local/lib/node_modules |
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[] { |