1.0.0 • Published 4 years ago

@nggondolas/global-tokens v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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;
    }
}
1.0.0

4 years ago

0.0.1

4 years ago