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
.../?user=something<script>alert(1)</script>... |
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
yarn global add @bazel/ibazel | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/master/.bazelrc > .bazelrc | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/master/WORKSPACE > WORKSPACE | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/master/BUILD.bazel > BUILD.bazel | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/master/src/BUILD.bazel > ./src/BUILD.bazel | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/master/e2e/protractor.on-prepare.js > ./e2e/protractor.on-prepare.js | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/master/e2e/BUILD.bazel > ./e2e/BUILD.bazel | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/236406851409a88e85b3cdc9e6eaa250061fd7cc/src/main.ts > ./src/main.ts | |
curl https://raw.githubusercontent.com/alexeagle/canonical-angularcli-app/06151761ded53d22a2d03b9e6d67c31f045559af/src/index.html > ./src/index.html |
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
<angular-switchery #f="ngForm" [formControl]="switcheryControl"></angular-switchery> | |
switcheryControl.value : {{f.value}} |
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
<angular-switchery disabled="disabled"></angular-switchery> |
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
<angular-switchery [(ngModel)]="swticherModel"></angular-switchery> | |
<angular-switchery [(ngModel)]="swticherModel"></angular-switchery> | |
Switcher: {{swticherModel? 'ON' : 'OFF'}} |
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
platformBrowserDynamic().bootstrapModule(AppModule, [ | |
{ | |
defaultEncapsulation: ViewEncapsulation.None | |
} | |
]); |
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
// src/app/auth/auth.service.ts | |
import { HttpRequest } from '@angular/common/http'; | |
// ... | |
export class AuthService { | |
cachedRequests: Array<HttpRequest<any>> = []; | |
public collectFailedRequest(request): void { |
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 'rxjs/add/operator/map'; | |
export class JwtInterceptor implements HttpInterceptor { | |
constructor(public auth: AuthService) {} | |
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | |
return next.handle(req).map((event: HttpEvent<any>) => { | |
if (event instanceof HttpResponse) { |
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 { Injectable } from '@angular/core'; | |
import { | |
HttpRequest, | |
HttpHandler, | |
HttpEvent, | |
HttpInterceptor | |
} from '@angular/common/http'; | |
import { AuthService } from './auth/auth.service'; | |
import { Observable } from 'rxjs/Observable'; |
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
const myInput = document.getElementById('myInput'); | |
//1 - input | |
//2 - fetch | |
//3 - debounce | |
//Why not Promise? | |
/* | |
//---------------------1------------------------ |