### Hierarchy

- AtomViewModel
  - MovieListViewModel

## Index

### Constructors

- constructor

### Properties

- app
- movies
- postInit
- selectedMovie

### Accessors

- errorSelectedMovie
- errors
- isReady
- isValid
- parent

### Methods

- dispose
- init
- onDelete
- onItemClick
- onPropertyChanged
- onReady
- refresh
- registerDisposable
- resetValidations
- runAfterInit
- setupWatch

## Constructors

### constructor

- new MovieListViewModel(app: App, windowService: WindowService): MovieListViewModel

- Overrides AtomViewModel.constructor

  - Defined in src/web/samples/demo/views/MovieListViewModel.ts:27

  #### Parameters

  - ##### app: App

  - ##### windowService: WindowService

  #### Returns MovieListViewModel

## Properties

### app

app: App

Inherited from AtomViewModel.app

- Defined in src/view-model/AtomViewModel.ts:160

### movies

movies: IMovie[] = [{ label: "First", category: "None" },{ label: "True Lies", category: "Action" },{ label: "Jurassic Park", category: "Adventure" },{ label: "Big", category: "Kids" },{ label: "Inception", category: "Suspense" },{ label: "Last", category: "None" },]

- Defined in src/web/samples/demo/views/MovieListViewModel.ts:17

### postInit

postInit: Function[]

Inherited from AtomViewModel.postInit

- Defined in src/view-model/AtomViewModel.ts:68

### selectedMovie

selectedMovie: IMovie

- Defined in src/web/samples/demo/views/MovieListViewModel.ts:27

## Accessors

### errorSelectedMovie

- get errorSelectedMovie(): string

- - Defined in src/web/samples/demo/views/MovieListViewModel.ts:36

  #### Returns string

### errors

- get errors(): Array<object>

- Inherited from AtomViewModel.errors

  - Defined in src/view-model/AtomViewModel.ts:83

  #### Returns Array<object>

### isReady

- get isReady(): boolean

- Inherited from AtomViewModel.isReady

  - Defined in src/view-model/AtomViewModel.ts:79

  If it returns true, it means all pending initializations have finished

  #### Returns boolean

### isValid

- get isValid(): boolean

- Inherited from AtomViewModel.isValid

  - Defined in src/view-model/AtomViewModel.ts:133

  Returns true if all validations didn't return any error. All validations are decorated with @Validate decorator.

  #### Returns boolean

### parent

- get parent(): AtomViewModel
- set parent(v: AtomViewModel): void

- Inherited from AtomViewModel.parent

  - Defined in src/view-model/AtomViewModel.ts:110

  Returns parent AtomViewModel if it was initialized with one. This property is also useful when you open an popup or window. Whenever a popup/window is opened, ViewModel associated with the UI element that opened this popup/window becomes parent of ViewModel of popup/window.

  #### Returns AtomViewModel

- Inherited from AtomViewModel.parent

  - Defined in src/view-model/AtomViewModel.ts:113

  Returns parent AtomViewModel if it was initialized with one. This property is also useful when you open an popup or window. Whenever a popup/window is opened, ViewModel associated with the UI element that opened this popup/window becomes parent of ViewModel of popup/window.

  #### Parameters

  - ##### v: AtomViewModel

  #### Returns void

## Methods

### dispose

- dispose(): void

- Inherited from AtomViewModel.dispose

  - Defined in src/view-model/AtomViewModel.ts:239

  dispose method will be called when attached view will be disposed or when a new view model will be assigned to view, old view model will be disposed.

  memberof

    AtomViewModel

  #### Returns void

### init

- init(): Promise<any>

- Inherited from AtomViewModel.init

  - Defined in src/view-model/AtomViewModel.ts:230

  Put your asynchronous initialization here

  memberof

    AtomViewModel

  #### Returns Promise<any>

### onDelete

- onDelete(data: IMovie): Promise<any>

- - Defined in src/web/samples/demo/views/MovieListViewModel.ts:44

  #### Parameters

  - ##### data: IMovie

  #### Returns Promise<any>

### onItemClick

- onItemClick(data: IMovie): void

- - Defined in src/web/samples/demo/views/MovieListViewModel.ts:40

  #### Parameters

  - ##### data: IMovie

  #### Returns void

### Protected onPropertyChanged

- onPropertyChanged(name: string): void

- Inherited from AtomViewModel.onPropertyChanged

  - Defined in src/view-model/AtomViewModel.ts:307

  #### Parameters

  - ##### name: string

  #### Returns void

### Protected onReady

- onReady(): void

- Inherited from AtomViewModel.onReady

  - Defined in src/view-model/AtomViewModel.ts:269

  #### Returns void

### refresh

- refresh(name: string): void

- Inherited from AtomViewModel.refresh

  - Defined in src/view-model/AtomViewModel.ts:219

  Refreshes bindings associated with given property name

  #### Parameters

  - ##### name: string

    name of property

  #### Returns void

### Protected registerDisposable

- registerDisposable(d: IDisposable): IDisposable

- Inherited from AtomViewModel.registerDisposable

  - Defined in src/view-model/AtomViewModel.ts:263

  Register a disposable to be disposed when view model will be disposed.

  memberof

    AtomViewModel

  #### Parameters

  - ##### d: IDisposable

  #### Returns IDisposable

### resetValidations

- resetValidations(resetChildren?: boolean): void

- Inherited from AtomViewModel.resetValidations

  - Defined in src/view-model/AtomViewModel.ts:168

  Resets validations and all errors are removed.

  #### Parameters

  - ##### Default value resetChildren: boolean = true

    reset child view models as well. Default is true.

  #### Returns void

### runAfterInit

- runAfterInit(f: function): void

- Inherited from AtomViewModel.runAfterInit

  - Defined in src/view-model/AtomViewModel.ts:184

  Runs function after initialization is complete.

  #### Parameters

  - ##### f: function

    function to execute

    - - (): void

      - #### Returns void

### Protected setupWatch

- setupWatch(ft: string[][] | function, proxy?: function, forValidation?: boolean, name?: string): IDisposable

- Inherited from AtomViewModel.setupWatch

  - Defined in src/view-model/AtomViewModel.ts:289

  Execute given expression whenever any bindable expression changes in the expression.

  For correct generic type resolution, target must always be `this`.

       this.setupWatch(() => {
           if(!this.data.fullName){
               this.data.fullName = `${this.data.firstName} ${this.data.lastName}`;
           }
       });

  template

    T

  memberof

    AtomViewModel

  #### Parameters

  - ##### ft: string[][] | function

  - ##### Optional proxy: function

    - - (...v: any[]): void

      - #### Parameters

        - ##### Rest ...v: any[]

        #### Returns void

  - ##### Optional forValidation: boolean

  - ##### Optional name: string

  #### Returns IDisposable

Generated using TypeDoc