Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Angular 15 stand alone components #247

Open
vytautas-pranskunas- opened this issue Nov 19, 2022 · 2 comments
Open

Support Angular 15 stand alone components #247

vytautas-pranskunas- opened this issue Nov 19, 2022 · 2 comments
Labels
BREAKING CHANGE Indicates a breaking change type: compatibility Indicates an issue that only occurs on specific browsers / operating systems / devices

Comments

@vytautas-pranskunas-
Copy link

With new Angular 15 tandalone components became stable, however there is a little problem with this library when using them.
We have to importmodule when app is bootstrapping:

const providers = importProvidersFrom(
    ...
    NotifierModule.withConfig({
        position: {
            horizontal: { position: 'right' },
            vertical: { position: 'top' },
        },
        behaviour: {
            autoHide: 3000,
        },
    }),
);

bootstrapApplication(AppComponent, {
    providers: [
        providers,
       ...
    ],
}).catch((err) => console.error(err));

and we cannot import Notifier component it self to app.component.ts like this:

@Component({
    selector: 'app-root',
    standalone: true,
    imports: [CommonModule, RouterModule, NotifierNotificationComponent], <--------------- not stand alone
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent implements OnInit, OnDestroy {

instead we have to import module which resets config.
There is a little fix for that - we need to declare notifier as standalone.

@dominique-mueller dominique-mueller added type: compatibility Indicates an issue that only occurs on specific browsers / operating systems / devices BREAKING CHANGE Indicates a breaking change labels Jan 30, 2023
@ahmad-ben
Copy link

they haven't solved this problem yet??

@Packers64
Copy link

I'm having the same problem. Can't figure out how to set config while having service be a standalone component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE Indicates a breaking change type: compatibility Indicates an issue that only occurs on specific browsers / operating systems / devices
Projects
None yet
Development

No branches or pull requests

4 participants