引导轮播不适用于角度 ng 路由
Bootstrap Carousel not working with angular ng-route
我正在使用ng-route创建一个简单的angularjs应用程序,索引.html页面有一个引导轮播,单击该按钮时具有下一个和上一个按钮正在导航到下一个Html页面 下面是我的 plunkr 链接以及我的脚本.js文件 如果我错了,请进行更正,我已经搜索了很多,但没有找到适合此问题的解决方案
工作链接
var appname = angular.module('appname', ['ngRoute', 'ngAnimate']);
appname.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'indexView.html',
controller: 'indexController'
}).
when('/about', {
templateUrl: 'about.html',
}).
when('/contact', {
templateUrl: 'contact.html',
}).
otherwise({
redirectTo: '/'
});
}]).controller('MainCtrl', function($scope, $location) {
$scope.isIndexPage = function() {
return $location.path() === '/';
}
});
检查一下,现在一切正常。
http://plnkr.co/edit/JcInw9ZUz6vfFO5InV7N?p=preview
重写了MainCtrl
部分,在创建一次MainCtrl
并且从未更新之前,但现在它会侦听路线更改并相应地隐藏轮播。
$scope.$on('$routeChangeSuccess', function () {
$scope.isIndexPage = $location.path() === '/';
});
相关文章:
- 正在使用$location.path(.)路由ng视图
- 当在ng视图中加载新路由时,Tabbing(tabindex)针对错误的元素
- AngularJS路由在初次点击时没有加载ng模板
- ng路由injectore:modulerr中出错[$injector:modulerr]http://errors.a
- 角度.js - 识别通过路由或 ng 控制器调用的控制器
- ng-animate 当 ng-view 通过路由更新时
- 使用ng-include调用控制器时AngularJS路由解析
- 避免使用ng路由对无散列url进行路由
- ng 路由不起作用指令
- ng路由不起作用.我不知道错误是什么,因为控制台中没有显示任何内容
- ng路由白色页面后刷新页面显示
- ng路由传递参数不起作用
- 尝试角度ng路由时出错
- 引导轮播不适用于角度 ng 路由
- 角度 ng 路由和 ng-view
- ng路由工作不正常
- AngularJS ng路由如何在解析时发出http请求
- Angularjs-ng路由在IE9上不起作用-视图不显示
- ng路由以读取链接并定位具有相同名称的特定控制器
- Angular.js:未捕获对象行36 ng路由