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
export type Book = { | |
id: string; | |
volumeInfo: { | |
title: string; | |
subtitle: string; | |
authors: string[]; | |
publisher: string; | |
publishDate: string; | |
description: string; | |
averageRating: number; |
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
constructor(private http: HttpClient) { | |
this.bookStore.observeQuery().pipe(filter(Boolean), | |
debounceTime(200), | |
distinctUntilChanged(), | |
tap(async (query: string) => { | |
const bo: Observable<Book[]> = this.searchAPI(query); | |
const books: Book[] = await bo.toPromise(); | |
this.bookStore.reset(); | |
this.bookStore.postA(books); | |
}) |
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 { NgModule } from '@angular/core'; | |
import { | |
MatInputModule, | |
MatCardModule, | |
MatButtonModule, | |
MatSidenavModule, | |
MatListModule, | |
MatIconModule, | |
MatToolbarModule, |
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 isActiveTodoInCollection$:Observable<boolean> = | |
combineLatest(active$, | |
collection$, | |
(a, c)=>{ | |
if (getMapValue(central.active)) { | |
return collection.containsById(getMapValue(central.active)); | |
} | |
return false; | |
}); |
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 { Component, Input } from '@angular/core'; | |
import { Book } from '../model/'; | |
@Component({ | |
selector: 'bc-book-authors', | |
template: ` | |
<h5 mat-subheader>Written By:</h5> | |
<span> | |
{{ authors | bcAddCommas }} | |
</span> |
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() { | |
// server-side search | |
fromEvent(this.input.nativeElement,'keyup') | |
.pipe( | |
untilDestroyed(this), | |
filter(Boolean), | |
debounceTime(150), | |
distinctUntilChanged(), | |
tap(async (event:KeyboardEvent) => { | |
console.log(`The input value is ${this.input.nativeElement.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
import { Component, Output, EventEmitter } from '@angular/core'; | |
@Component({ | |
selector: 'fs-toolbar', | |
template: ` | |
<mat-toolbar color="primary"> | |
<button mat-icon-button (click)="openMenu.emit()"> | |
<mat-icon>menu</mat-icon> | |
</button> | |
<ng-content></ng-content> |
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 googleLogoURL = | |
"https://raw.githubusercontent.com/fireflysemantics/logo/master/Google.svg"; | |
@Component({ | |
selector: 'my-app', | |
templateUrl: './app.component.html', | |
styleUrls: [ './app.component.css' ] | |
}) | |
export class AppComponent { | |
constructor ( |
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
export class Console { | |
textarea: HTMLTextAreaElement; | |
constructor(container: HTMLElement) { | |
this.textarea = document.createElement("textarea"); | |
container.appendChild(this.textarea); | |
} | |
/** | |
* @param | |
*/ | |
log(message: string, type?: string) { |
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 postCategories: PostCategory[] = [ | |
{ | |
id: "iot", | |
name: "IOT", | |
summary: "Internet of Things Posts.", | |
posts: [ | |
{ | |
id: "thermostat", | |
title: "Thermostat", | |
content: "How to make it really cold fast!" |
NewerOlder