JSFiddle - React, Tailwind, and code Playground
by Bretto
HTML
<div ng:app="test">
<div ng-controller="Ctrl2">
<my-directive></my-directive>
</div>
</div>
<span style="color: red" id="output">Out</span>
CSS
</style><script src="http://docs-next.angularjs.org/angular-1.0.0rc8.min.js"></script>
<style>
JavaScript
angular.module('test', [])
.directive("myDirective", function () {
return {
restrict:'E',
replace:true,
scope:true,
template:'<ul><li ng-repeat="res in resources" check-last>{{res.name}}</li></ul>'
};
})
.directive('checkLast', function () {
return function (scope, element, attrs) {
if (scope.$position === "last") {
element.ready(function () {
alert(element.parent().html());
})
}
}
});
function Ctrl2($scope) {
$scope.resources = [
{name:'alice'},
{name:'bob'},
{name:'charlie'}
];
}