# View

**Kind:** Class

**Source:** `Pams/Web/Pams.WebApp/Client/app/models/dashboard/data-source-schema/view.model.ts` (line 4)

**Part of:** [Pams](subsystem-pams)

`View` models a view within the dashboard data-source schema. Its `clone()` method creates a separate `View` instance for workflows that need to copy schema state without changing the original object.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `clone` | `clone(model: View)` | `void` |

## Properties

| Property | Type |
|---|---|
| `Id` | `string` |
| `Name` | `string` |
| `ViewID` | `string` |
| `Schema` | `string` |
| `NameSpace` | `string` |
| `Columns` | `Column[]` |
| `ConString` | `string` |
| `ConName` | `string` |
| `Data` | `any` |

## Where it refuses work

- `View` stops the work with an early return when `model == null`.

## Diagram

```mermaid
graph LR
  Schema[Data-source schema] --> View[View]
  View --> Clone[clone()]
  Clone --> Copy[Separate View instance]
```

## Usage

```ts
import { View } from './view.model';

const view = new View();

const copiedView = view.clone();

// Update copiedView without changing view.
```

## AI Coding Instructions

- Use `clone()` before changing a `View` that may also be referenced by existing dashboard schema state.
- Keep cloning behavior aligned with the fields added to `View`.
- Do not assume changes to a cloned instance update the original instance.
- Import `View` from the dashboard data-source schema model path when building schema-related features.

## Relationships

- IMPORTS → `Column`
- IMPORTS → `GetColumnPrameter`

## Used by

3 references from 3 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (3)

- `DataSourceService` — `Pams/Web/Pams.WebApp/Client/app/services/dashboard/data-source.service.ts`:1
- `DashboardWidget` — `Pams/Web/Pams.WebApp/Client/app/models/dashboard/dashboard-widget.model.ts`:11
- `DataSourceConnection` — `Pams/Web/Pams.WebApp/Client/app/models/dashboard/data-source-schema/data-source-connection.model.ts`:4
