Created
May 29, 2018 12:24
-
-
Save jplemieux66/20a1b1102578417a4a20e60a1cc0633e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { Store } from '@ngrx/store'; | |
import { Observable } from 'rxjs/Observable'; | |
import { ChangeSelectedWeek } from '../../actions/dates'; | |
import { WeekInfo } from '../../models/week-info.model'; | |
import * as fromProjects from '../../reducers'; | |
@Component({ | |
selector: 'projects-panel', | |
templateUrl: './projects-panel.component.html', | |
styleUrls: ['./projects-panel.component.css'] | |
}) | |
export class ProjectsPanelComponent { | |
selectedWeekInfo$: Observable<WeekInfo> | |
constructor(private store: Store<fromProjects.State>) { | |
this.selectedWeekInfo$ = this.store.select(fromProjects.getSelectedWeekInfo) | |
} | |
weekSelectedChanged(selectedWeekInfo: WeekInfo) { | |
this.store.dispatch(new ChangeSelectedWeek(selectedWeekInfo)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment