JSFiddle - React, Tailwind, and code Playground
testing controllers (AngularJS)
by ikaruss
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<body></body>
JavaScript
var module = angular.module('Module', []);
module.controller('Ctrl', ['$scope', function($scope) {
$scope.obj = {
bool: false
};
}]);
module.directive('element', [function () {
return {
restrict: 'E',
replace: true,
template: (function(){/*
<div>
<input type="checkbox" ng-model="obj.bool" />
<input type="checkbox" ng-model="obj.bool" />
</div>
*/}).toString().slice(14,-3),
controller: function ($scope) {
$scope.obj = {
bool: true
};
}
};
}]);
var el = angular.element('<element/>')
angular.bootstrap(el, ['Module']);
angular.element(document.body).prepend(el);