# View

**Kind:** Class

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

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

`View` is a dashboard data-source-schema model. It represents a view definition and exposes `clone()` to create a separate `View` instance when changes must not affect the original.

## 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
  View[View instance] --> Clone[clone()]
  Clone --> Copy[Copied View instance]
```

## Usage

```ts
import { View } from './models/dashboard/data-source-schema/view.model';

declare const view: View;

const editableView = view.clone();

// Apply changes to editableView without changing view.
```

## AI Coding Instructions

- Call `clone()` before changing a `View` that may still be referenced elsewhere in dashboard state.
- Keep clone behavior aligned with the fields defined on `View`.
- When adding fields to `View`, update `clone()` so copied instances retain the new field values.
- Treat the value returned by `clone()` as a separate model instance.

## Relationships

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

## Used by

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

### Imported by (4)

- `RightButtonsComponent` — `Pams/Web/Pams.Web/Client/app/components/shared/breadcrumbs/right-buttons/right-buttons.component.ts`:1
- `DataSourceService` — `Pams/Web/Pams.Web/Client/app/services/dashboard/data-source.service.ts`:1
- `DashboardWidget` — `Pams/Web/Pams.Web/Client/app/models/dashboard/dashboard-widget.model.ts`:10
- `DataSourceConnection` — `Pams/Web/Pams.Web/Client/app/models/dashboard/data-source-schema/data-source-connection.model.ts`:4
