UNPKG

531 BMarkdownView Raw
1# view.prototype
2
3Define prototype functions on the view.
4
5**`my-view.xjs`**:
6```js
7{View DIV
8 view.prototype: getName
9}
10```
11
12**`my-view.js`**:
13```js
14var CODE_BEHIND = {
15 getName: function() { return "My-View"; }
16}
17```
18
19**`test.js`**:
20```js
21var View = require("my-view");
22var myview = new View();
23console.log( "Name", myview.getName() );
24```
25
26If you have several static functions, you can provide an array:
27```js
28{View DIV
29 view.prototype: [getName, incCounter]
30}
31```
32
33----
34[Back](xjs.view.md)