[v1] app refusing to start up when code added


#1

So hi guys, i am using the version 1.2.0 and i can’t get the app to load up when i add an expected peice of code. Here is the top part of my app.js.

var SERVER_URL = "http://localhost:65534";

var myApp = new Framework7({
template7Pages: true,
precompileTemplates: true, //
domCache: true,
template7Data: {
context: {“title”:“Pizza”,“description”:“description data-context-name”},
},
preprocess: function (content, url, next) {
next(content);
}
});

// Export selectors engine
var $$ = Dom7;

// Add main view
var mainView = myApp.addView(’.view-main’);

var curSelPage = “”;
var curContactID;
var curConvArr

The problem happens when i try to input the neccesary

`// Select Template

var template = $$(’#random-template’).html();

// Compile and render
var compiledTemplate = Template7.compile(template);`

Help, please!


#2

Any errors in console?

Might just be forum formatting error, but the quotes(’) you use in:
var template = $$(’#random-template’).html();
Is not standard single quote ASCII. Try:
var template = $$('#random-template').html();


#3

no errors in the console and yes, it is a formatting thing from the forum. Help, please.


#4

I assume the rest of the code is correct in you are using the compiler?
compiledTemplate({data});

Debug: Steps 1-3 can use console.log to make life easy
Step 0: Make sure Template7 .js file is linked in your page. Since it is not part of the F7 lib
Step 1: check template is correct (Grab a known working template or make a super simple one)
Step 2: Check Template7.compile(template) is returning a function
Step 3: Check html being returned by the above function is correct


#5

@plague69
Step 0: in the f7 docs, it is stated that template 7 is included in the framework. How do i include it in?
Step 1: i have one from the urban dictionary API demo example.
Step 2 and Step 3: on it right away.

Can i share a jsfiddle of the present state of the code before the alterations? Here it is. https://jsfiddle.net/brt027z5/2/

Thank you!