This file contains hidden or 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({ | |
selector: 'wt-title-v1', | |
template: `<h1>v1: {{ title }}</h1>` | |
}) | |
export class TitleV1Component { | |
@Input() title: string; | |
} | |
@NgModule({ | |
imports: [CommonModule], |
This file contains hidden or 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
recognition = new webkitSpeechRecognition(); | |
recognition.continuous = true; | |
recognition.lang = 'fr-FR'; | |
recognition.onresult = console.log; | |
recognition.start(); |
This file contains hidden or 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({ | |
selector: 'wt-logo', | |
template: ` | |
<img [src]="getLogoUrl()"> | |
<button (click)="company = 'wishtack'">WISHTACK</button> | |
<button (click)="company = 'google'">GOOGLE</button> | |
` | |
}) | |
export class LogoComponent { |
This file contains hidden or 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({ | |
selector: 'wt-logo', | |
template: `<img [src]="logoUrl">` | |
}) | |
export LogoComponent { | |
logoUrl = require('!!url-loader!./logo.svg'); | |
} |
This file contains hidden or 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, 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; |
This file contains hidden or 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, 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; |
This file contains hidden or 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, 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> | |
` | |
}) |
This file contains hidden or 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 } from '@angular/core'; | |
import { Subscription, interval } from 'rxjs'; | |
@Component({ | |
template: `<div>{{ count }}</div>` | |
}) | |
export class CounterComponent implements OnDestroy, OnInit { | |
count: number; | |
This file contains hidden or 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 } from '@angular/core'; | |
import { interval } from 'rxjs'; | |
@Component({ | |
template: `<div>{{ count$ | async }}</div>` | |
}) | |
export class CounterComponent { | |
count$ = interval(1000); |