-
Notifications
You must be signed in to change notification settings - Fork 47
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
eventClick/ dayClick that trigger EventEmitter object #2
Comments
hi Clemouuche, can you put the code of your component so I can better suggest the best practice? |
Just to know, I'm using ionic2 `import { Component, Input, Output, NgZone, EventEmitter } from '@angular/core'; import { DataService } from '../../providers/data-service'; /* See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
} |
Hi Clemouuche, the problem is not related to the component itself, but the scoping inside your clickday function. in your fullCalendar class, try the following:
OR
then you should be able to output the event to your parent component More info at: Note that you don't need to check if valueChange is defined or not anymore, since you already initiated it on variable declaration
hope this helps |
Hi @nekken , good day! I'm having a problem to show those event from database. When I hard coded those event it works but when I'm calling it from API it doesn't work. here's my code
I hope you can help me with this one, I am very new in Angular 2 |
@alyssa19 the response object from the server should have property id, title and start, then only it will bind properly and then you can have other properties inthe object but those 3 are must. |
@alyssa19 did you manage to get this to work? I'm having the same issue. Can't get it to display API data from an observable at all. |
If you're having problems getting it to display the data from an observable, have a look at akveo/ngx-admin#331 I got it to work & there's an example in there |
Hello guys,
As you've written into the doc, I created a new component that has '<angular2-fullcalendar [options]="calendarOptions">' in the template.
Then I put my calendarOptions during the ngAfterViewInit(). My events display well.
Now, I added '@output('change') valueChange: EventEmitter = new EventEmitter();' into my component because when eventClick or dayClick are triggered, I want to do a this.valueChange.emit({value: this.eventOut}). (because after that, I want to do a this.nav.push or something from my current page)
But unfortunately, it says "cannot read emit of undefined". Maybe I'm wrong but what I understand is that this method is not called from my component but into $('angular2-fullcalendar') so that it can't find my valueChange variable.
Now, my question is "What is the best practice to do it correctly ?".
The text was updated successfully, but these errors were encountered: