Updating our model for ordering tasks

As a first step, we should enable our task model for ordering. By introducing an order field on our task object, we can then use that field to sort tasks accordingly. Let's make the following changes to our model file, located in src/app/model.ts:

export interface Task {  readonly id?: number;  readonly projectId?: number;  readonly title: string;  readonly done: boolean;  readonly order: number;}…export type DraggableType = 'task';

We have also added a new type alias, DraggableType, which we're using to identify things that can be dragged within our application. We will use this type to make sure that we can only drag and drop to locations that support the given type.

Since we have changed the model for our ...

Get Mastering Angular Components now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.