import ContentAttribute from 'clinical6/src/helpers/content/ContentAttribute.js'ContentAttribute
Mixin Extends:
Helper class representing an eDiary Entry Group.
Constructor Summary
| Public Constructor | ||
| public |
constructor(json: Object) Constructor for helper class representing an eDiary Entry Group |
|
Member Summary
| Public Members | ||
| public get |
|
|
| public set |
|
|
Method Summary
| Public Methods | ||
| public |
Deletes an attribute |
|
| public |
async save(): Promise<ContentAttribute> Saves a content attribute (insert if id doesn't exist, update if it does) |
|
Inherited Summary
| From class ContentAttributeModel | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
Public Constructors
public constructor(json: Object) source
Constructor for helper class representing an eDiary Entry Group
Override:
ContentAttributeModel#constructorParams:
| Name | Type | Attribute | Description |
| json | Object | json api response from server |
Public Members
public get contentType: ContentType source
public set contentType: ContentType source
Public Methods
public delete(): Promise<any> source
Deletes an attribute
Example:
import { ContentAttribute, Client } from 'clinical6';
// Removes content from server and local storage
const contentAttribute = new ContentAttribute({...});
contentAttribute.delete();
// No longer in storage
Client.instance.storageUtility.has('contentAttribute', { id: 1 });
public async save(): Promise<ContentAttribute> source
Saves a content attribute (insert if id doesn't exist, update if it does)
Example:
import { ContentAttribute, clinical6 } from 'clinical6';
// Inserts new contentAttribute (no existing id)
const contentAttribute = new ContentAttribute(
"type": "dynamic_content__attribute_keys",
"attributes": {
"required": true
});
contentAttribute.save();
// Updates existing contentAttribute(has existing id)
clinical6.get(ContentAttribute).then(contentAttributes => contentAttributes[0].save());
Manual
Reference
Source
Test
