我是否创建了多个html页面,其中index.html包含滑动了一些图像的bootstrap轮播,我通过ngroute连接所有html页面,问题是在index.html加载轮播时如果点击旋转木马中的下一个或上一个按钮,它只是导航到另一个html页面或它的同一页面,我特此粘贴一个工作的plunker链接供参考: 请帮我解决这个问题。
Am i creating multiple html pages, where index.html consist of the bootstrap carousel which slided through some couple of images and am i connecting all the html pages through ngroute,The problem is when loading the carousel in index.html if click the next or prev button in the carousel it just navigating to the another html page or it's same page,i hereby paste a working plunker link for reference: http://plnkr.co/edit/VUS8RjQkVQabEBxRWMdB?p=info Please help me to resolve this issues.
答案 0 :(得分:0)
只需在主控制器中使用它
$scope.$on('$routeChangeSuccess', function () {
$scope.isIndexPage = $location.path() === '/';
});