JSFiddle - React, Tailwind, and code Playground

by Kriem

HTML

<script src="http://code.angularjs.org/1.0.0rc10/angular-1.0.0rc10.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>

<div ng-app="test">
    <list>
        <li><a href="#">Test this is</a></li>
        <li class="selected"><a href="#">Test this is too</a></li>
        <li><a href="#">Test this is third</a></li>
    </list>
</div>

JavaScript

var blink = angular.module('test', [])
    .directive('list', ['$scope', function($scope) {
    return {
        restrict: 'E',
        transclude: true,
        scope: {},
        controller: ['$scope', function($scope, $element) {
            
            function orderList(){
                
                console.log($element);
                
                $element.prepend(
                    
                    $element.find('li.selected').remove() 
                );
            }
            orderList();
        }],
        template: '<span ng-transclude></span>',
        replace: false
    };
}]);