Hello,
how can I use the framework7 instance inside my “real_estates” class?
class real_estate {
constructor() {
console.log('Constructor called');
}
loadDefaultRealEstates() {
functions.setOutPut('Call loadDefaultRealEstates()');
$.ajax(config.api_url + 'real_estates/list', {
accepts: {},
data: {
api_key: config.api_key,
},
context: this,
success: function (data) {
$('#real_estate_default_view').html('');
var real_estate;
for (real_estate in data) {
$('#real_estate_default_view').append(this.createRealEstatesCard(data[real_estate]));
}
},
error: function (xhr, ajaxOptions, thrownError) {
app.dialog.alert('Status: '+ xhr.status +', Error: '+ thrownError);
}
});
}
import RealEstate from './real_estate.js';
let real_estates = new RealEstate();
real_estates.loadDefaultRealEstates();
// Dom7
var $$ = Dom7;
var offlineAlert = false;
// Framework7 App main instance
var app = new Framework7({
root: '#app', // App root element