Angular+JQ+Bootstrap
by Bretto
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://code.angularjs.org/1.0.0rc8/angular-1.0.0rc8.js"></script>
<div ng-controller="MyCtrl">
<hello></hello>
</div>
JavaScript
angular.module('myApp', []).directive('hello', function($compile) {
return {
restrict: 'E',
link: function(scope, elm, attrs) {
scope.helloVal = 'initial';
elm.append( $compile('<b>{{helloVal}}</b><br />')(scope) );
clickyElm = angular.element('<a ng-click="helloVal = \'super!\'">Change it!</a>');
elm.append( $compile(clickyElm)(scope) );
}
};
});
function MyCtrl($scope) {}