Store and serve your app from local JSON files and local images.
Load model from file and render:
{
"$jason": {
"head": {
"actions": {
"$load": {
"type": "$require",
"options": {
"items": "file://data.json"
},
"success": {
"type": "$render"
}
}
}
}
}
}
Load view from file
{
"$jason": {
"body": {
"@": "file://template.json"
}
}
}
Load controller (actions) from file
{
"$jason": {
"head": {
"actions": {
"$load": {
"@": "file://initialize.json"
}
}
}
}
}
Display local images from file:
{
"type": "image",
"url": "file://avatar.png"
}
The global key-value store is an app-wide key-value database.
"$global.key"
Setting a global variable: Pass a key/value pair as options
.
{
"type": "$global.set",
"options": {
"name": "Ben"
}
}
Getting a global variable: Use the $global.KEY_NAME
template expression to retreive
{
"type": "label",
"text": "{{$global.name}}"
}
Sometimes it may make sense to store data on the cloud while storing the app logic on the device. Sometimes maybe the other way around. There are many combinations you can implement. For example:
With the new offline features, now you can:
Want to learn more?