View Summary The abstract base class for views. Description The View abstract class is the abstract base class for views in Altitude MVC/MVP applications. In Altitude, views should be separated from the domain ("dumb view"). Examples Basic Usage 1234567891011121314151617181920import Altitude.Frontend; external jQuery, $; // Import jQuery (optional) class Contact : View{ // Construct a view based on the specified template Contact() { super( """ <div class="contact">{{firstName}} {{lastName}}</div> """ ); } // Describe how the HTML gets rendered once the model changes override renderTemplate(string html) { $("#contact").html(html); }} Methods htmlThe generated HTML output. initializePerforms the initial render. renderTemplateThe template method for specifying how the generated HTML should be rendered. templateThe compiled Handlebars template. updateOnlyUpdates the view in response to specific changes in the model. View (Constructor)Constructs a view and binds it to the specified Handlebars template. Share HTML | BBCode | Direct Link