Something went wrong. Try again.
Some angular code i wrote while following: Angular - The Complete Guide (2025 Edition)
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233import { Component, Input } from '@angular/core';
import { TaskComponent } from './task/task.component';import { NewTaskComponent } from './new-task/new-task.component';import { TasksService } from './tasks.service';
@Component({ selector: 'app-tasks', standalone: true, templateUrl: './tasks.component.html', styleUrl: './tasks.component.css', imports: [TaskComponent, NewTaskComponent],})export class TasksComponent { @Input({ required: true }) userId!: string; @Input({ required: true }) name!: string; isAddingTask = false;
constructor(private tasksService: TasksService) {}
get selectedUserTasks() { return this.tasksService.getUserTasks(this.userId); }
onStartAddTask() { this.isAddingTask = true; }
onCloseAddTask() { this.isAddingTask = false; }}