@musora/models
v0.1.3
Published
Data models for all Musora back-end services
Downloads
5
Keywords
Readme
js-models - @musora/models
Data models for all Musora back-end services
Installation
Yarn
yard add @musora/models
NPM
npm install @musora/models --save
Usage
ContentModel
Accessing Data
import { ContentModel } from '@musora/models';
const content = new ContentModel(post);
const contentTitle = content.getField('title');
Extending Models for Data Binding
import { ContentModel } from '@musora/models';
export class Song extends ContentModel {
constructor(){
super();
this.cardTitle = this.getField('title');
this.cardDescription = this.getData('description');
}
}
React
<ContentCard
title={song.cardTitle}
description={song.cardDescription}
/>
Vue
<ContentCard
:title="song.cardTitle"
:description="song.cardDescription"
/>