Direcitve TEst
leanwx.com
HTML
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/black-tie/jquery-ui.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<div>
<div ng-repeat="x in ['blue', 'green']" class="{{x}}" id="{{x}}box">
<h3 insert-style>{{theStyle['background-color']}}</h3>
</div>
</div>
<button ng-disabled>
</button>
CSS
.blue{
background-color:blue;
}
.green{
background-color:green;
}
JavaScript
var leanwxApp = angular.module('LeanwxApp', [], function () {});
var controllers = {};
var directives = {};
directives.insertStyle = [ function(){
return {
link: function(scope, element, attrs) {
scope.theStyle = window.getComputedStyle(element[0].parentElement);
}
}
}];
leanwxApp.controller(controllers);
leanwxApp.directive(directives);