Nectar Documentation
Demo
Buy Now
Search…
Introduction
Getting Started
Installation
Directory Structure
Dependencies & Plugins
The Basics
Configuration
Routes
App Layout
App Initialization
Theming
Internationalization
UI/UX
Components
Screens
Advanced
Web APIs
Cordova Plugins
Integrations
Publishing
Progressive Web App
Cordova/PhoneGap App
Powered By
GitBook
Configuration
The configuration variables related to your app are stored inside
/assets/custom/js/config.js
file.
You can store configuration variables such as API keys related to third-party services inside this file.
The example structure of storing variables is —
1
window.config.facebook {
2
appId: '12345679098765431'
3
}
Copied!
You can access these variables from inside JavaScript or from inside the HTML template.
1
// Accessing from inside JavaScript
2
console.log(window.config.facebook.appId);
3
// Or you can also access this way, once your app is initialized.
4
console.log(app.data.config.facebook.appId); // This is the recommended way
Copied!
1
<!-- Accessing from inside HTML template -->
2
<template>
3
<div>{{$root.config.facebook.appId}}</div> <!-- After parsing, the output will be 12345679098765431 -->
4
</template>
Copied!
Getting Started - Previous
Dependencies & Plugins
Next - The Basics
Routes
Last modified
3yr ago
Copy link