Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
larukedi edited this page Nov 18, 2014 · 7 revisions

Initialization

Usage: $l.mvc.init()

$l.ready(function() {
    $l.mvc.init();
});

Basic Binding

Usage: $l.mvc.bind(app, model[, controller])

<div lr-app="test">
    {{hello}}

    <span style="color: {{favoritecolor}};">{{name}}</span>
</div>
$l.ready(function() {
    var myModel = { hello: 'hi', name: 'eser', favoritecolor: 'orange' };

    $l.mvc.init();
    $l.mvc.bind('test', myModel);
});

Binding with controller

Usage: $l.mvc.bind(app, model[, controller])

<div lr-app="test">
    {{hello}}

    <span style="color: {{favoritecolor}};">{{name}}</span>
</div>
function test($scope) {
    $scope.name = $scope.name.toUpperCase();
}

$l.ready(function() {
    var myModel = { hello: 'hi', name: 'eser', favoritecolor: 'orange' };

    $l.mvc.init();
    $l.mvc.bind('test', myModel);
});
Clone this wiki locally