@scribe-atp/angular
Observable API — ScribeService
Section titled “Observable API — ScribeService”ScribeService
Section titled “ScribeService”Injectable service (provided in root) with methods that return cold Observables. The fetch starts when you subscribe and is cancelled when you unsubscribe.
import { inject } from '@angular/core';import { ScribeService } from '@scribe-atp/angular';
const scribe = inject(ScribeService);getSite
Section titled “getSite”getSite(author: string, siteSlug: string): Observable<Site>| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
siteSlug | string | Site rkey — derive with toSlug(domain) |
Returns a cold Observable. Subscribe with the async pipe for automatic unsubscription on component destroy.
getArticle
Section titled “getArticle”getArticle(author: string, articleSlug: string): Observable<Article>| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
articleSlug | string | Article rkey / slug |
Signals API
Section titled “Signals API”injectSite
Section titled “injectSite”function injectSite(author: string, siteSlug: string): { site: Signal<Site | null>; loading: Signal<boolean>; error: Signal<Error | null>;}Injection function (must be called in an injection context). Fetches a site immediately and returns readonly signals. The request is aborted when the host component is destroyed.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
siteSlug | string | Site rkey |
injectArticle
Section titled “injectArticle”function injectArticle(author: string, articleSlug: string): { article: Signal<Article | null>; loading: Signal<boolean>; error: Signal<Error | null>;}Injection function (must be called in an injection context). Fetches an article immediately and returns readonly signals. The request is aborted when the host component is destroyed.
| Parameter | Type | Description |
|---|---|---|
author | string | Author handle or DID |
articleSlug | string | Article rkey / slug |
All types from @scribe-atp/core are re-exported:
import type { Site, Article, ArticleRef, SiteGroup } from '@scribe-atp/angular';See the core reference for type definitions.