Angular: Empty Fiddle
http://angularjs.org/
by koningskristof
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<div ng-show="dataShow" datarow="" data-label="dataLabel" data-name="dataName">{{dataValue}}</div>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.dataValue = 'dataValue';
$scope.dataShow = false;
}
angular.module("myApp").directive("datarow", function () {
return {
template: "<div ng-show=\"data!==undefined\"><div><div><div>{{ label }}</div><div ng-transclude></div></div></div></div>",
restrict: "A",
transclude: true,
scope: {
label: "@",
data: "@",
name: "@",
},
replace:true
};
})