:)
I'm trying to use "owl carousel" jquery plugin with Angular.js directive, this is the html example (http://owlgraphic.com/owlcarousel/demos/images.html)
<div id="owl-demo">
<div class="item"><img src="assets/owl1.jpg" alt="Owl Image"></div>
<div class="item"><img src="assets/owl2.jpg" alt="Owl Image"></div>
<div class="item"><img src="assets/owl3.jpg" alt="Owl Image"></div>
<div class="item"><img src="assets/owl4.jpg" alt="Owl Image"></div>
</div>
Using simple Jquery Owl Carousel runs with:
$("#owl-demo").owlCarousel();
Now, i'm trying to use this with Angular.js using this directive:
'use strict';
angular.module('MyApp')
.directive('inccarousel', () ->
restrict: "A"
link: (scope, element, attrs) ->
$(element).owlCarousel()
)
And this angular view:
<div inccarousel>
<p inccarousel ng-repeat="foo in foobar">{{ foo }}</p>
</div>
But it doesn't work, When I looked the html output I got this:
....
<div inccarousel="" style="opacity: 0;">
<p ng-repeat="foo in foobar" class="ng-scope ng-binding">1</p>
<p ng-repeat="foo in foobar" class="ng-scope ng-binding">2</p>
<p ng-repeat="foo in foobar" class="ng-scope ng-binding">3</p>
<p ng-repeat="foo in foobar" class="ng-scope ng-binding">4</p>
<p ng-repeat="foo in foobar" class="ng-scope ng-binding">5</p>
<p ng-repeat="foo in foobar" class="ng-scope ng-binding">6</p>
<p ng-repeat="foo in foobar" class="ng-scope ng-binding">7</p>
</div>
....
Any body can help with this? :(
{{ foo }}
– Dennis Ruiz Nov 29 '13 at 13:25