Last active
September 5, 2018 09:28
-
-
Save YonathanMeguira/105d0a85395426ed22fd1cdecddf8ec8 to your computer and use it in GitHub Desktop.
shopping list
This file contains hidden or 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 { ListQuery, List } from '../state'; | |
import { ShopikaService } from '../state/shopika.service'; | |
import { ID } from '@datorama/akita'; | |
import { Observable } from 'rxjs'; | |
export class ListsComponent implements OnInit { | |
lists$: Observable<List[]>; | |
constructor( | |
private listQuery: ListQuery, | |
private shopikaService: ShopikaService | |
) { } | |
ngOnInit() { | |
this.lists$ = this.listQuery.selectAll(); | |
} | |
select(id: ID) { | |
this.shopikaService.setActive(id); | |
} | |
delete(id: ID) { | |
this.shopikaService.deleteList(id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment