aLight - The Basics

by lega911

HTML

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css">
<script src="http://angularlight.org/bin/alight_0.49b.min.js"></script>
<div al-app class="span4 well">
    <h3 al-get-scope="app.scope">Hello {{name}}!</h3>
</div>

JavaScript

alight.directives.al.getScope = function(elm, name, scope) {
    scope.$setValue.call(window, name, scope);
}

setTimeout(function() {
    app.scope.name = 'world';
    app.scope.$scan();
}, 2000);