My list comprises of Task items:
This is my template:
<div>
<p class="work-item-name">{{ task.Name }}</p>
<p class="assigned-to">{{ task.Assignee }}</p>
<button class="btn btn-primary btn-sm" ng-click="goBack()"><i class="fas fa-arrow-left"></i></button>
<button class="btn btn-primary btn-sm" ng-click="moveForward()"><i class="fas fa-arrow-right"></i></button>
<button class="btn btn-danger btn-sm" ng-click="removeTask()"><i class="fas fa-trash-alt"></i></button>
</div>
All these are nested within a taskList:
This is the taskList template:
<div id="{{ status }}" class="col-md-4 tasksContainer">
<ul class="list-group">
<li class="list-group-item flex-column">To Do</li>
<li ng-repeat="task in tasks | filter:{Status: 0}" class="list-group-item list-group-item-danger">
<task-card
task-details="task"
go-back-task="goBack()"
move-forward-task="moveForward()"
remove-task="removeTask()">
</task-card>
</li>
</ul>
</div>
I want to pass on the go back, move forward and delete task functions from the initial call:
<task-List
status="todo"
tasks="tasks"
go-back-task="goBack($event, task)"
move-forward-task="moveForward($event, task)"
remove-task="removeTask($event, task)">
</task-List>
to each individual task (in order for each task's button to alter its properties). But in my existing code, on the final call when the button is pressed, both $event and task appear as undefined. What would be the correct approach to passing down functions as parameters in such scenarios?