initialize

Summary

Performs the initial render.

Usage

public void initialize(Model model)

Parameters

model

The model to perform the initial render with.

Description

Performs the initial render by calling View.updateAll and View.render (in order).

Examples

Basic Usage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Altitude.Frontend;
 
class ContactModel : Model
{
    string name = "Test";
 
    override function toExternal() {
        return {
            name: this.name
        };
    }
}
class ContactView : View
{
    ContactView() {
        super("<div>{{name}}</div>");
    }
}
 
ContactModel model = new ContactModel();
ContactView view = new ContactView();
model.attach(view);
view.initialize(model);

Share

HTML | BBCode | Direct Link