我想在 ng-view 内的段落上应用一个精美的滚动条。我的模块代码是
var myweb = angular.module('myweb' , ['ngRoute', 'perfect_scrollbar']);
myweb.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/profile', {
templateUrl : 'ngHtml/profile.html',
controller : 'mainCtrl'
})
.when('/careers', {
templateUrl : 'ngHtml/careers.html',
controller : 'careersCtrl'
})
.otherwise({redirectTo:'/profile'});
});
ngHtml/careers.html 是
<div class="panel">
<div class="panel-heading bg-primary">
<h2>{{data.heading}}</h2>
</div>
<perfect-scrollbar class="scroller panel-body" wheel-propagation="true" wheel-speed="10" min-scrollbar-length="20">
....
...
..
.
</perfect-scrollbar>
</div>
这是完美的滚动条,我也尝试过ng-scrollbar和其他,但它不起作用。我无法在 ng-view 中启动滚动条指令的功能。