### File

`src/app/shared/models/todo.model.ts`

### Description

The todo class See TodoStore for service using it

### Extends

`Tada`

### Index

###### Properties

- Private _title
- Private #newprivateproperty
- completed
- dir
- editing
- Private Optional optionalProperty
- Optional pos
- url2state

###### Methods

- Private #clicked
- Abstract abstractMethod
- Async asyncMethod
- azert
- Static classMethod
- fakeMethod
- testCommentFunction

###### Accessors

- title
- runtimePath

### Constructor

`constructor(title: string)`
Defined in src/app/shared/models/todo.model.ts:66

The todo constructor Watch TodoStore for service using it

Parameters :

Name | Type | Optional
title | `string` | No

### Properties

Private _title
Type : `string`
Defined in src/app/shared/models/todo.model.ts:41
Title

Private #newprivateproperty
Type : `boolean`
Default value : `false`
Defined in src/app/shared/models/todo.model.ts:26
Another private property

completed
Type : `boolean`
Defined in src/app/shared/models/todo.model.ts:15
Completed status

dir
Type : `Direction`
Default value : `Direction.Left`
Defined in src/app/shared/models/todo.model.ts:36

editing
Type : `boolean`
Defined in src/app/shared/models/todo.model.ts:19
Editing status

Private Optional optionalProperty
Type : `boolean`
Defined in src/app/shared/models/todo.model.ts:28

Optional pos
Type : `PopupPosition`
Defined in src/app/shared/models/todo.model.ts:21

url2state
Default value : `() => {...}`
Defined in src/app/shared/models/todo.model.ts:96

### Methods

Private #clicked
`#clicked()`
Defined in src/app/shared/models/todo.model.ts:107
Returns : `void`

Abstract abstractMethod
`abstractMethod(input: string)`
Defined in src/app/shared/models/todo.model.ts:92

Parameters :

Name | Type | Optional
input | `string` | No

Returns : `string`

Async asyncMethod
`asyncMethod()`
Defined in src/app/shared/models/todo.model.ts:94
Returns : `any`

azert
`azert()`
Defined in src/app/shared/models/todo.model.ts:88
Returns : `number`

Static classMethod
`classMethod()`
Defined in src/app/shared/models/todo.model.ts:56
Returns : `string`

fakeMethod
`fakeMethod()`
Defined in src/app/shared/models/todo.model.ts:84
fakeMethod !! @example Usage of fakeMethod returns true; fakeMethod() Example : Usage of fakeMethod returns true; fakeMethod() Returns : `boolean`

testCommentFunction
`testCommentFunction(dig: number, str: string, bool: boolean)`
Defined in src/app/shared/models/todo.model.ts:32

Parameters :

Name | Type | Optional
dig | `number` | No
str | `string` | No
bool | `boolean` | No

Returns : `object`

### Indexable

`[index: number]: `string``
Defined in src/app/shared/models/todo.model.ts:28

### Accessors

title
get `title()`
Defined in src/app/shared/models/todo.model.ts:45
set `title(value: string)`
Defined in src/app/shared/models/todo.model.ts:52

Setter of _title

Parameters :

Name | Type | Optional | Description
value | `string` | No | The new title

Returns : `void`

runtimePath
get `runtimePath()`
Defined in src/app/shared/models/todo.model.ts:64
Returns the runtime path

# Todo class

    import { ElementRef } from '@angular/core';

    import { Direction } from '../miscellaneous/miscellaneous';

    export class Tada {}

    /**
     * The todo class
     * See {@link TodoStore} for service using it
     */
    export class Todo extends Tada {
        /**
         * Completed status
         */
        completed: boolean;
        /**
         * Editing status
         */
        editing: boolean;

        pos?: PopupPosition;

        /**
         * Another private property
         */
        #newprivateproperty: boolean = false;

        private optionalProperty?: boolean;

        [index: number]: string;

        testCommentFunction(dig: number, str: string, bool: boolean): object {
            return {};
        }

        dir: Direction = Direction.Left;

        /**
         * Title
         */
        private _title: string;
        /**
         * @return {string} _title value
         */
        get title() {
            return this._title;
        }
        /**
         * Setter of _title
         * @param  {string} value The new title
         */
        set title(value: string) {
            this._title = value.trim();
        }

        static classMethod() {
            return 'hello';
        }

        /**
         * Returns the runtime path
         * @returns {string}
         */
        get runtimePath() {
            return this._options.runtimePath;
        }

        /**
         * The todo constructor
         * Watch {@link TodoStore} for service using it
         */
        constructor(title: string) {
            this.completed = false;
            this.editing = false;
            this.title = title.trim();
        }

        /**
         *  fakeMethod !!
         *  @example <caption>Usage of fakeMethod</caption>
         *  returns true;
         *  fakeMethod()
         */
        fakeMethod(): boolean {
            return true;
        }

        azert() {
            return 5;
        }

        abstract abstractMethod(input: string): string;

        async asyncMethod() {}

        url2state = async <T>(defaults: Partial<T>) =>
            await this.route.queryParamMap
                .pipe(
                    /** use first to make sure this only runs at component init time */
                    first(),
                    map(r => {}),
                    catchError(e => {})
                )
                /** cast observable to promise */
                .toPromise();

        #clicked() {
            this.editing = true;
        }
    }

    export type PopupPosition = ElementRef | HTMLElement;

# results matching ""

# No results matching ""