1.2.3 • Published 9 years ago

gaffa-switch-container v1.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

gaffa-switch-container

switch container view for gaffa

Rendere different templates based on the result of an expression.

Install:

npm i gaffa-switch-container

Add to gaffa:

var SwitchContainer = require('gaffa-switch-container');

gaffa.registerCnstructor(SwitchContainer);

Usage

var switchContainer = new SwitchContainer();

// Add to gaffa...

API

Properties (instanceof Gaffa.Property)

content

What content to render

eg:

switchContainer.content.binding = '(? a "view1" "view2")';
switchContainer.content.templates = {
    "view1": someGaffaView,
    "view2": anotherGaffaView
};

You can also provide a template for if no templates match:

switchContainer.content.emptyTemplate = viewForEmpty
1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago