The jquery image slider works when i put it outside ng-view div. But doesn't work when i move it inside directives or when it is injected into ng-view
index.html
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="src/js/lightslider.js"></script> 
<script>
   $(document).ready(function() {
  $("#content-slider").lightSlider({
            loop:true,
            keyPress:true
        });
        $('#image-gallery').lightSlider({
            gallery:true,
            item:1,
            thumbItem:9,
            slideMargin: 0,
            speed:500,
            auto:true,
            loop:true,
            onSliderLoad: function() {
                $('#image-gallery').removeClass('cS-hidden');
            }  
        });
});
</script>
<body ng-controller="mainController">
<div class="wrapper">
   <div id="main">
    <!--code works when moved here-->
    <div ng-view></div>
Html code for the slider, It doesnt work inside a directive.
slider.html
    <div class="demo">
    <div class="item">            
        <div class="clearfix" style="max-width:474px;">
            <ul id="image-gallery" class="gallery list-unstyled cS-hidden">
                <li data-thumb="img/thumb/cS-1.jpg"> 
                    <img src="img/cS-1.jpg" />
                     </li>
                <li data-thumb="img/thumb/cS-2.jpg"> 
                    <img src="img/cS-2.jpg" />
                     </li>
                <li data-thumb="img/thumb/cS-3.jpg"> 
                    <img src="img/cS-3.jpg" />
                     </li> 
            </ul>
        </div>
    </div> 
</div> 
