以字母顺序编排的列表,带有 alpha 滚动条。
Configurable Ionic directive for alphabetically indexed list with an alpha scroll bar.
#Table of contents
bower install ion-alpha-scroll --saveion-alpha-scroll javascript and css file into your HTML file:ion-alpha-scroll as a dependency on your Ionic app:angular.module('myApp', [
'ionic',
'ion-alpha-scroll'
]);To use the ion-alpha-scroll directive simply add the following snippet to your template:
Content Goes here...
where 'ng-model' is the model you would like to sort and 'key' is the name of the key you would like to sort by.
The 'subheader' attribute is optional, to be set if using a subheader in the view to allow proper scroll height.
To display the properties of each item in the model, you can use the 'item' object within the directive:
Heres a quick example:
services.js
…controllers.js
angular.module('example.controllers', [])
.controller('contactsCtrl', ['$scope','Contacts',function($scope, Contacts) {
$scope.contacts = Contacts.all();
)]};
contacts-list.html
Initial inspiration and code taken from this codepen by mikelucid
The Ionic alpha-scroll directive is available under the MIT license.
暂无开放 Issues,或尚未同步最近议题。