Created
September 9, 2021 11:28
-
-
Save NyaGarcia/c0601f68912cd126f1e80909b5cba8b2 to your computer and use it in GitHub Desktop.
Adding inProgress and done arrays
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 { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; | |
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-todo-list', | |
templateUrl: './todo-list.component.html', | |
styleUrls: ['./todo-list.component.css'], | |
}) | |
export class TodoListComponent implements OnInit { | |
constructor() {} | |
ngOnInit(): void {} | |
todos = ['Fix bugs', 'Update kernel', 'Eat more pizza', 'Fix more bugs']; | |
inProgress = ['Refactor code']; | |
done = ['Eat pizza']; | |
drop(event: CdkDragDrop<string[]>) { | |
moveItemInArray(this.todos, event.previousIndex, event.currentIndex); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment