JSFiddle - React, Tailwind, and code Playground
by mongus
HTML
<script src="http://code.angularjs.org/1.1.3/angular.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css">
<div ng-controller="parentController">
<wrapper>
<input type='text' ng-model='stuff' />
{{stuff}}
<button class="primary" ng-click='dothestuff()'>Do the <stuff></stuff></button>
</wrapper>
</div>
JavaScript
var testapp = angular.module('testapp', []);
testapp.controller('parentController', ['$scope', '$window', function($scope, $window) {
$scope.stuff = 'arf';
$scope.dothestuff = function () {
$window.alert($scope.stuff);
};
}]);
testapp.directive('wrapper', function () {
return {
restrict: 'E',
replace: true,
scope: false,
transclude: true,
template: '<div style="background:#666"><div ng-transclude></div></div>'
};
});