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() {} |
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
<div cdkDropList class="todo-list" (cdkDropListDropped)="drop($event)"> | |
<h3>TO DO</h3> | |
<div class="awesome-todo" *ngFor="let todo of todos" cdkDrag>{{todo}}</div> | |
</div> |
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
<div cdkDropList class="todo-list"> | |
<h3>TO DO</h3> | |
<div class="awesome-todo" *ngFor="let todo of todos" cdkDrag>{{todo}}</div> | |
</div> |
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 { 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() {} |
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
.awesome-div { | |
align-items: center; | |
background-color: #00b2a7; | |
border-radius: 4px; | |
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), | |
0 1px 5px 0 rgba(0, 0, 0, 0.12); | |
color: #fff; | |
cursor: move; | |
display: flex; | |
font-weight: bold; |
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
<div class="awesome-div" cdkDrag> | |
Awesome draggable div | |
</div> |
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 { AppComponent } from './app.component'; | |
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { DragDropModule } from '@angular/cdk/drag-drop'; | |
import { NgModule } from '@angular/core'; | |
@NgModule({ | |
declarations: [AppComponent], | |
imports: [BrowserModule, BrowserAnimationsModule, DragDropModule], | |
providers: [], |
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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'filterFalsy' | |
}) | |
export class FilterFalsyPipe implements PipeTransform { | |
transform(value: unknown, ...args: unknown[]): unknown { | |
return null; | |
} |
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
<h1>{{title | uppercase}}</h1> |
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
export class FilterFalsyPipe {} |