Skip to content

@scribe-atp/angular

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(author: string, siteSlug: string): Observable<Site>
ParameterTypeDescription
authorstringAuthor handle or DID
siteSlugstringSite rkey — derive with toSlug(domain)

Returns a cold Observable. Subscribe with the async pipe for automatic unsubscription on component destroy.

getArticle(author: string, articleSlug: string): Observable<Article>
ParameterTypeDescription
authorstringAuthor handle or DID
articleSlugstringArticle rkey / slug

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.

ParameterTypeDescription
authorstringAuthor handle or DID
siteSlugstringSite rkey

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.

ParameterTypeDescription
authorstringAuthor handle or DID
articleSlugstringArticle 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.