Skip to content

Instantly share code, notes, and snippets.

<input type="file" class="file-upload" onchange="console.log(event.target.files)">
@jhades
jhades / 01.ts
Last active January 12, 2024 16:29
RxJs SwitchMap Operator
import {of} from "rxjs";
import {delay} from "rxjs/operators";
function simulateHttp(val: any, delay:number) {
return of(val).pipe(delay(delay));
}
@jhades
jhades / 01.html
Last active July 11, 2023 20:12
Angular Custom Form Validators: Complete Guide - https://blog.angular-university.io/angular-custom-validators/
User Login Form:
<form [formGroup]="form">
<input matInput type="email" name="email"
placeholder="Email" formControlName="email">
<input matInput type="password"
placeholder="Password" formControlName="password">
<button [disabled]="!form.valid">
@jhades
jhades / 01.ts
Last active May 4, 2023 19:02
Angular Security - Authentication with JWT
{
"sub": "353454354354353453",
"exp": 1504699256
}
import {MatDialogModule} from "@angular/material";
@NgModule({
declarations: [
...
CourseDialogComponent
],
imports: [
...
@jhades
jhades / 01.ts
Last active March 30, 2023 09:27
Angular Form Array: Complete Guide - blog.angular-university.io/angular-form-array/
form = this.fb.group({
title: ['', {
validators: [
Validators.required,
Validators.minLength(5),
Validators.maxLength(60)
],
asyncValidators: [courseTitleValidator(this.courses)],
updateOn: 'blur'
{
"publicKey":"BLBx-hf2WrL2qEa0qKb-aCJbcxEvyn62GDTyyP9KTS5K7ZL0K7TfmOKSPqp8vQF0DaG8hpSBknz_x3qf5F4iEFo",
"privateKey":"PkVHOUKgY29NM7myQXXoGbp_bH_9j-cxW5cO-fGcSsA"
}
@jhades
jhades / 01.html
Last active February 7, 2023 16:29
The Qwik Framework: An In-Depth Introduction - https://blog.qwikacademy.io/qwik-introduction
<html>
<body>
<ul class="courses-list">
<li>Angular Material Course</li>
<li>Angular Forms In Depth</li>
<li>Angular Router In Depth</li>
<li>Reactive Angular Course</li>
<li>RxJs In Practice Course</li>
@jhades
jhades / 01.html
Created January 20, 2023 14:40
Why Qwik? A Quick Introduction To The Qwik Framework
<!DOCTYPE html><html lang="en">
<head>
<meta charset="utf-8">
<title>Your application</title>
<link rel="stylesheet" href="bundle.css">
</head>
<body>
@jhades
jhades / 01.ts
Last active January 20, 2023 09:32
How to Show Or Hide Template Elements in Qwik - https://blog.qwikacademy.io/qwik-conditional-rendering-show-hide/
export const App = component$<{isLoggedIn:boolean}>( (props) => {
const {isLoggedIn} = props;
return (
<div class="container">
<div className="user-profile">
<img src="https://qwik.builder.io/logos/qwik-logo.svg" />
</div>
<div class="main">