Skip to content

MVC Style Application

Kris Erickson edited this page Jan 21, 2014 · 1 revision

1. Create a templates directory, and add a page called home.ejs

<div id="home">
    <div class="topcoat-navigation-bar"> <!-- Navigation bar -->
        <div class="topcoat-navigation-bar__item center full">
            <h1 class="topcoat-navigation-bar__title">Topcoat Touch</h1>
        </div>
    </div>
    <div class="content scrollable"> <!-- containers with the class scrollable are automatically hooked into iscroll -->
        ...Content goes here
    </div>
</div>

2. Initialize your page

(function() {
    // Create the topcoatTouch object
    var tt = new TopcoatTouch();
    tt.createController('home');
});

3. Run the app in your browser

4. For more details checkout [the MVC Sample Application]((//github.com/kriserickson/topcoat-touch/tree/master/examples/mvc)