F7 v2.0.2 and "addView is not a function"

Hello All!

I installed latest v2.0.2 and try test page like in Docs (copied from “Basic Android/Material App Layout”)

In my-init.js I have (like in Docs):
var myApp = new Framework7();

// If we need to use custom DOM library, let’s save it to $$ variable:
var $$ = Dom7;

// Add view
var mainView = myApp.addView(’.view-main’, {
// Because we want to use dynamic navbar, we need to enable it for this view:
dynamicNavbar: true
});

But in console I have error:
Uncaught TypeError: myApp.addView is not a function

What is wrong?

Thank you

1 Like

I downgrade to 1.6.5 and it works

Hey @XPEH

The Android/Material App Layout published is the official documentation for version 1, the official documentation version 2 is not available. (Its working on that)

Use kitchen-sink from GitHub for more details.

The example in kitchen-sink show, view-init class, here.

So, check this app.js example, addView function not is necessary

Regards