angularjs和引导的javascript [英] angularjs and bootstrap javascript

查看:109
本文介绍了angularjs和引导的javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个角应用一个Twitter的引导传送带。如果我使用的数据幻灯片属性这样的:

I have a twitter bootstrap carousel in an angular app. If I use the data-slide attribute thus:

<a data-slide="prev" href="#myCarousel" class="left carousel-control">&lsaquo;</a>

那么 HREF =#myCarousel 在PTED为路线和当前页面间$ P $重新加载。 (我用HTML5模式)

then the href=#myCarousel in interpreted as a route and the current page is reloaded. (I am using HTML5 mode)

我可以通过这个替换得到传送带工作:

I can get carousel working by replacing with this:

<a href="#" class="left carousel-control" ng-click="carouselPrev()">&lsaquo;</a>

和在控制器:

$scope.carouselPrev = function(){
    $('#myCarousel').carousel('prev');
};

但什么是做到这一点的正确方法?

but what is the right way to do this?

推荐答案

还是......用这个:角UI - 引导(包括旋转木马指令)

Or...use this: Angular-UI - Bootstrap (includes a carousel directive.)

这篇关于angularjs和引导的javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆