@nggondolas/global-tokens
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

GlobalTokens

Usage

import {Component, inject, InjectionToken} from '@angular/core';
import {USER_AGENT} from '@nggondolas/global-tokens';

export const GET_BROWSER = new InjectionToken<string>('User Agent', {
    providedIn: 'root',
    factory: () => inject(USER_AGENT).toLowerCase()
});

@Component({})
export class AppComponent {
    constructor(@Inject(GET_BROWSER) private readonly userAgent: string) {}

    get foo(): string {
        return this.userAgent;
    }
}

Package Sidebar

Install

npm i @nggondolas/global-tokens

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

19.4 kB

Total Files

20

Last publish

Collaborators

  • gondolasnus