diff --git a/apps/got/src/app/app.component.html b/apps/got/src/app/app.component.html
index 0f4018b6..891a1d24 100644
--- a/apps/got/src/app/app.component.html
+++ b/apps/got/src/app/app.component.html
@@ -1 +1,19 @@
-Welcome to {{ title }}!
+
character works!
diff --git a/apps/got/src/app/character/character.component.ts b/apps/got/src/app/character/character.component.ts new file mode 100644 index 00000000..4b2be43d --- /dev/null +++ b/apps/got/src/app/character/character.component.ts @@ -0,0 +1,8 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-character', + templateUrl: './character.component.html', + standalone: true, +}) +export class CharacterComponent {} diff --git a/apps/got/src/app/data.service.ts b/apps/got/src/app/data.service.ts new file mode 100644 index 00000000..c75da0a2 --- /dev/null +++ b/apps/got/src/app/data.service.ts @@ -0,0 +1,28 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root', +}) +export class DataService { + private API = `https://www.anapioficeandfire.com/api`; + + constructor(private http: HttpClient) {} + + getBooks(): Observable<{ url: string; numberOfPages: string; name: string }[]> { + return this.http.get<{ url: string; numberOfPages: string; name: string }[]>(`${this.API}/books`); + } + + getBook(id: string): Observable<{ characters: string[] }> { + return this.http.get<{ characters: string[] }>(`${this.API}/books/${id}`); + } + + getCharacters(): ObservableYou can activate distributed tasks executions and caching by running:
-nx connect- What is Nx Cloud? -
Here are some things you can do with Nx:
-# Generate UI lib -nx g @nx/angular:lib ui -# Add a component -nx g @nx/angular:component ui/src/lib/button-
nx show project game-of-thrones --web-
nx graph-
# see what's been affected by changes -nx affected:graph -# run tests for current changes -nx affected:test -# run e2e tests for current changes -nx affected:e2e-
- Carefully crafted with - -
-