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 16, 2014 · 7 revisions

Basic Binding

<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

<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