Skip to content

Instantly share code, notes, and snippets.

View yjaaidi's full-sized avatar
💭
👨🏻‍🍳 helping you cook better apps

Younes Jaaidi yjaaidi

💭
👨🏻‍🍳 helping you cook better apps
View GitHub Profile
@yjaaidi
yjaaidi / +title-v1.module.ts
Last active June 7, 2019 20:34
Reactive Component Loader Demo
@Component({
selector: 'wt-title-v1',
template: `<h1>v1: {{ title }}</h1>`
})
export class TitleV1Component {
@Input() title: string;
}
@NgModule({
imports: [CommonModule],
@yjaaidi
yjaaidi / speech-recognition-playground.js
Last active October 11, 2018 09:03
Speech Recognition Playground
recognition = new webkitSpeechRecognition();
recognition.continuous = true;
recognition.lang = 'fr-FR';
recognition.onresult = console.log;
recognition.start();
@Component({
selector: 'wt-logo',
template: `
<img [src]="getLogoUrl()">
<button (click)="company = 'wishtack'">WISHTACK</button>
<button (click)="company = 'google'">GOOGLE</button>
`
})
export class LogoComponent {
@Component({
selector: 'wt-logo',
template: `<img [src]="logoUrl">`
})
export LogoComponent {
logoUrl = require('!!url-loader!./logo.svg');
}
import { Component, OnInit } from '@angular/core';
import { Scavenger } from '@wishtack/rx-scavenger';
import { interval } from 'rxjs';
@Component({
template: `<div>{{ count }}</div>`
})
export class CounterComponent implements OnDestroy, OnInit {
count: number;
import { Component, OnInit } from '@angular/core';
import { Scavenger } from '@wishtack/rx-scavenger';
import { interval } from 'rxjs';
@Component({
template: `<div>{{ count }}</div>`
})
export class CounterComponent implements OnDestroy, OnInit {
count: number;
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subject, interval } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
template: `
<div>{{ count }}</div>
<button (click)="startCounting()">Start Counting</button>
`
})
import { Component } from '@angular/core';
import { interval } from 'rxjs';
import { shareReplay } from 'rxjs/operators';
@Component({
template: `
<div>{{ count$ | async }}</div>
<div>{{ count$ | async }}</div>
`
})
import { Component } from '@angular/core';
import { Subscription, interval } from 'rxjs';
@Component({
template: `<div>{{ count }}</div>`
})
export class CounterComponent implements OnDestroy, OnInit {
count: number;
import { Component } from '@angular/core';
import { interval } from 'rxjs';
@Component({
template: `<div>{{ count$ | async }}</div>`
})
export class CounterComponent {
count$ = interval(1000);