| appHref |
appHref()
|
|
Get the default application href
Returns :
WritableSignal<string>
|
| resolveAppUrl | ||||||||||||
resolveAppUrl(href: string, value: string)
|
||||||||||||
|
Resolve an url against the application href. If the url starts with the application href it is removed, otherwise the url is returned unchanged.
Parameters :
Returns :
string
The resolved url |
| arrayAppend | ||||||
arrayAppend(array, items)
|
||||||
|
Appends items to an array
Parameters :
Returns :
void
|
| assetHref |
assetHref()
|
|
Get the default asset href
Returns :
WritableSignal<string>
|
| resolveAssetUrl | ||||||||||||
resolveAssetUrl(href: string, value: string)
|
||||||||||||
|
Resolve an url against the asset href
Parameters :
Returns :
string
The resolved url |
| buildEventData | ||||||||||||||||||||
buildEventData(instance: AnalyticsInstance, config: HraAnalyticsPluginConfig, event: string, props)
|
||||||||||||||||||||
|
Builds the data to send to analytics. Adds common fields like app, version, etc. and normalizes event payloads.
Parameters :
Returns :
object
Data to send to analytics |
| hraAnalyticsPlugin | ||||||||
hraAnalyticsPlugin(config: HraAnalyticsPluginConfig)
|
||||||||
|
An
Parameters :
Returns :
AnalyticsPlugin
An analytics plugin |
| createCategoryPreferences | ||||||||
createCategoryPreferences(enabled: boolean)
|
||||||||
|
Helper for creating categories enabled/disabled records
Parameters :
Returns :
ConsentCategories
A record of all categories with their values set to |
| createEvent | ||||||||||||||||
createEvent(type: string, category: EventCategory, trigger?: EventTrigger)
|
||||||||||||||||
|
Create a new event
Parameters :
Returns :
AnalyticsEvent<P>
A new event |
| createFeature | ||||||||||||
createFeature(kind: F, providers)
|
||||||||||||
|
Create a new feature object with a kind and providers
Parameters :
Returns :
ProviderFeature<F, P>
A feature object |
| getFeatureProviders | ||||||||
getFeatureProviders(feature: ProviderFeature)
|
||||||||
|
Get the providers from a feature object
Parameters :
Returns :
P[]
Array of providers |
| createHrefProvider | ||||||||
createHrefProvider(provide: RawProvideHrefFn)
|
||||||||
|
Wraps a href provider function with more permissive input types
Parameters :
Returns :
ProvideHrefFn
A provider function |
| createUrlResolverFn | ||||||||
createUrlResolverFn(injectResolver: InjectUrlResolverFn)
|
||||||||
|
Create a function that produces resolved url signals
Parameters :
Returns :
Signal<string>
A function to create resolved url signals |
| createUrlResolverInjector | ||||||||||||
createUrlResolverInjector(injectHref: InjectHrefFn, resolve: UrlResolverImplFn)
|
||||||||||||
|
Create a new injection function that returns an url resolver. The resulting injection function must be called in an injection context.
Parameters :
Returns :
InjectUrlResolverFn
An injection function for getting the resolver |
| extractData | ||||||||
extractData(router: Router)
|
||||||||
|
Extracts the data from route using the router instance.
Parameters :
Returns :
Data
Data from the current route. |
| routeData |
routeData()
|
|
Fetches the custom data from the current route.
Returns :
Signal<Data>
Signal containing data from the current route. |
| filterFalse | ||||||||
filterFalse(obj: T)
|
||||||||
|
Creates a new object where any keys with a value strictly equal to false are removed
Parameters :
Returns :
Partial<T>
Filtered object |
| limitStackTrace | ||||||||||||
limitStackTrace(stack: string, maxLength: number)
|
||||||||||||
|
Truncates a stack trace to a maximum length
Parameters :
Returns :
string
A stack with a length no greater than |
| pick | ||||||||||||
pick(obj: T, keys)
|
||||||||||||
|
Pick a set of properties from an object
Parameters :
Returns :
Pick<T, K>
A subset of the object |
| pickAttributes | ||||||||||||
pickAttributes(el: T, attributes)
|
||||||||||||
|
Pick a set of attributes from an element. Excludes attributes not present on the element.
Parameters :
Returns :
Partial<Record<K, string>>
Values by attribute name |
| serialize | ||||||
serialize(value)
|
||||||
|
Serializes complex values into simpler types. Currently handles the following objects:
Parameters :
Returns :
unknown
A new value to serialize |
| findOrThrow | ||||||||||||
findOrThrow(array, pred, error?)
|
||||||||||||
|
Searches an array for an item matching the provided predicate. Throws if there is no match.
Parameters :
Returns :
T
The first matching item |
| getNoMatchError | ||||||||
getNoMatchError(error)
|
||||||||
|
Creates an error
Parameters :
Returns :
Error
A new error with the provided message |
| getImportMeta |
getImportMeta()
|
|
Get a mocked version of
Returns :
ImportMeta
Mocked import.meta |
| getImportMetaUrl |
getImportMetaUrl()
|
|
Get a mocked version of
Returns :
string
Mocked import.meta.url |
| getImportMeta |
getImportMeta()
|
|
Gets
Returns :
ImportMeta
import.meta |
| getImportMetaUrl |
getImportMetaUrl()
|
|
Gets
Returns :
string
import.meta.url |
| hraEventFilterPlugin | ||||||||
hraEventFilterPlugin(config: HraEventFilterPluginConfig)
|
||||||||
|
An
Parameters :
Returns :
AnalyticsPlugin
An analytics plugin |
| injectDocument |
injectDocument()
|
|
Inject the global document, i.e. the main rendering context
Returns :
Document
The document object |
| injectFeaturePath |
injectFeaturePath()
|
|
Injects the feature path for the current location
Returns :
Signal<string>
A signal with the current feature path |
| injectLogEvent |
injectLogEvent()
|
|
Injects a functional equivalent of
Returns :
void
A function to log events |
| injectWindow |
injectWindow()
|
|
Inject the global window
Returns :
unknown
The window object |
| isAbsolute | ||||||||
isAbsolute(path: string)
|
||||||||
|
Test whether a path is an absolute url
Parameters :
Returns :
boolean
true if the path is absolute, false otherwise |
| joinWithSlash |
joinWithSlash(start: string, end: string)
|
|
Joins two paths with a signle slash between them
Returns :
string
The concatenated path |
| stripLeadingHash | ||||||||
stripLeadingHash(fragment: string)
|
||||||||
|
Remove the leading hash symbol from a fragment (if present)
Parameters :
Returns :
string
New fragment |
| stripTrailingSlash | ||||||||
stripTrailingSlash(path: string)
|
||||||||
|
Remove the trailing slash from a path while preserving the fragment and query parameters (if present)
Parameters :
Returns :
string
New url |
| isAuxClick | ||||||||
isAuxClick(event: MouseEvent)
|
||||||||
|
Test whether a mouse event is an auxiliary click
Parameters :
Returns :
boolean
true if the event is an auxiliary click, false otherwise |
| monitorHeight | ||||||
monitorHeight(elementFn)
|
||||||
|
Monitors the height of a given element.
Parameters :
Returns :
Signal<number>
Height as a signal. |
| pageHref |
pageHref()
|
|
Get the default page href
Returns :
WritableSignal<string>
|
| resolvePageUrl |
resolvePageUrl(href: string, value: string)
|
|
Resolve an url against the page href
Returns :
string
The resolved url |
| provideAnalytics | ||||||
provideAnalytics(...features: undefined)
|
||||||
|
Provide analytics with features
Parameters :
Returns :
EnvironmentProviders
Environment providers |
| withErrorHandler | ||||||||
withErrorHandler(config: AnalyticsErrorHandlerConfig)
|
||||||||
|
Install a global
Parameters :
Returns :
AnalyticsFeature
An analytics feature |
| withPlugins | ||||||
withPlugins(...plugins: undefined)
|
||||||
|
Add one or more
Parameters :
Returns :
AnalyticsFeature
An analytics feature |
| withRouterEvents |
withRouterEvents()
|
|
Log events from the angular router to analytics
Returns :
AnalyticsFeature
An analytics feature |
| provideRouterExt | ||||||
provideRouterExt(...features: undefined)
|
||||||
|
Provide additional router features.
Must be used along side of
Parameters :
Returns :
EnvironmentProviders
Environment providers |
| setupRouterEventListener |
setupRouterEventListener()
|
|
Setup a router event listener that logs page views and errors to analytics
Returns :
void
|