Proper migration of TuiNotification in Taiga UI v3 to v4

Discussão em 'Angular' iniciado por Aleksandra, Abril 14, 2025.

  1. Aleksandra

    Aleksandra Guest

    I am doing Taiga UI migation from v3 to v4 in Angular project. How should TuiNotification be used in v4, if I want to use it for constants like TuiNotification.Warning. This worked in v3, but it was depricated and they suggested to use TuiNotificationT from the same package, but it doesn't exist in v4.

    Here's example of how the current code looks like:

    ...
    import { TuiNotification } from '@taiga-ui/core';
    ...

    @Injectable()
    export class SomeInputService extends RxState<{
    }> {
    constructor(
    private notifications: TuiAlertService
    ) {
    super();

    this.doSomething();
    }

    private doSomething() {
    if (!something) {
    return this.showNotification(
    marker('Not working'),
    marker('Wrong file'),
    **TuiNotification.Warning**
    );
    }
    else {
    return this.showNotification(
    marker('Some error'),
    text ?? '',
    **TuiNotification.Error**
    );
    }
    }
    }



    The error I get is Property 'Warning' does not exist on type 'typeof TuiNotification'.ts

    Continue reading...

Compartilhe esta Página