added ability to remove column

This commit is contained in:
Nicolas Constant 2019-01-29 22:50:25 -05:00
parent 4daa0e83b0
commit ed0d7c57c8
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { Store } from '@ngxs/store';
import { StreamElement, RemoveStream } from '../../../states/streams.state';
@Component({
selector: 'app-stream-edition',
@ -6,8 +9,9 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./stream-edition.component.scss']
})
export class StreamEditionComponent implements OnInit {
@Input() streamElement: StreamElement;
constructor() { }
constructor(private readonly store: Store) { }
ngOnInit() {
}
@ -24,6 +28,7 @@ export class StreamEditionComponent implements OnInit {
delete(): boolean {
console.log('delete');
this.store.dispatch([new RemoveStream(this.streamElement.id)]);
return false;
}
}

View File

@ -13,7 +13,8 @@
</a>
</div>
<app-stream-edition class="stream-edition" *ngIf="editionPanelIsOpen"></app-stream-edition>
<app-stream-edition class="stream-edition" *ngIf="editionPanelIsOpen"
[streamElement]="streamElement"></app-stream-edition>
<app-stream-statuses class="stream-statuses" [streamElement]="streamElement" [goToTop]="goToTopSubject.asObservable()"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)"></app-stream-statuses>