03.03.2015 Views

First Demo Flip Book

This is my First Demo Flip Book

This is my First Demo Flip Book

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Displaying a Static View 11<br />

1 <br />

2 Text from a different template...<br />

3 <br />

Nothing special going on here, we’ve simply got different text to demonstrate the different template<br />

being used. Next, we need to provide the template to the view when we instantiate it, like so:<br />

1 var staticView = new ContactManager.StaticView({<br />

2 template: "#different-static-template"<br />

3 });<br />

And there we have it! When this view is displayed in our main region, the new text will be displayed.<br />

Here’s our index.html with a dynamically provided template:<br />

index.html<br />

1 <br />

2 <br />

3 <br />

4 <br />

5 Marionette Contact Manager<br />

6 <br />

7 <br />

8 <br />

9<br />

10 <br />

11<br />

12 <br />

13 <br />

14 <br />

15 Contact manager<br />

16 <br />

17 <br />

18 <br />

19<br />

20 <br />

21 Here is static content in the web page. You'll notice that it gets<br />

22 replaced by our app as soon as we start it.<br />

23 <br />

24<br />

25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!