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

Angular 2 RC.6 - Toasty Module. #33

Closed
uvarajthulasiram opened this issue Sep 8, 2016 · 2 comments
Closed

Angular 2 RC.6 - Toasty Module. #33

uvarajthulasiram opened this issue Sep 8, 2016 · 2 comments

Comments

@uvarajthulasiram
Copy link

I've updated to RC.6 and Toasty is not adjusting well!

In the Component decorator, I'm getting error on the line where I'm passing 'ToastyComponent' into the directives array. I would prefer to add a module in to my app.module.ts file instead...

import { Component } from '@angular/core';

import { ToastyComponent } from 'ng2-toasty';

import { Auth } from './auth.service';
import { NotificationService } from './shared/notification.service';

@Component({
    moduleId: module.id,
    selector: 'my-app',
    templateUrl: 'app.component.html',
    directives: [ ToastyComponent ],
    providers: [
                Auth,
                NotificationService]
})
export class AppComponent {
    constructor(private _auth: Auth) {
    }
}
@jasondana
Copy link

jasondana commented Sep 8, 2016

A ToastyModule does exist currently. Unfortunately the latest revisions have not been posted to npm due to the build failures.

https://github.com/akserg/ng2-toasty/blob/master/index.ts#L36

On another note. You might want to review the RC6 changes. They've removed a lot of deprecated pieces. For instance, directives can no longer be declared in the Component decorator.

If you would like to get your app up and running using the latest npm build, what I've done is created a shared module (suggested by the angular2 documentation) and exported ToastComponent and ToastyComponent. This SharedModule is then imported in the modules you want to use ng2-toasty in.

import { NgModule } from '@angular/core';
import { ToastComponent, ToastyComponent } from 'ng2-toasty';

@NgModule({
  declarations: [ ToastComponent, ToastyComponent ],
  exports: [ ToastComponent, ToastyComponent ]
})
export class SharedModule { }

@uvarajthulasiram
Copy link
Author

Thanks. That worked. I'd added a shared module, exported the components and imported it in app.module.ts. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants