mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
List updates and directives with it!
This commit is contained in:
43
js/ext/angular/src/directive/ionicList.js
vendored
43
js/ext/angular/src/directive/ionicList.js
vendored
@ -5,21 +5,52 @@ angular.module('ionic.ui.list', ['ionic.service'])
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {},
|
||||
template: '<ul class="list-group" ng-transclude></ul>',
|
||||
scope: {
|
||||
isEditing: '='
|
||||
},
|
||||
template: '<ul class="list" ng-class="{\'list-editing\': isEditing}" ng-transclude></ul>',
|
||||
link: function($scope, $element, $attr) {
|
||||
var lv = new ionic.views.List({el: $element[0]});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
|
||||
.directive('listItem', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {}
|
||||
template: '<li class="list-item">' +
|
||||
' <div class="list-item-edit" ng-if="item.canDelete">' +
|
||||
' <button class="button button-icon"><i class="icon-minus-sign"></i></button>' +
|
||||
' </div>' +
|
||||
' <div class="list-item-content" ng-transclude>' +
|
||||
' </div>' +
|
||||
' <div class="list-item-buttons" ng-if="item.canSwipe">' +
|
||||
' <button class="button button-{{button.type}}" ng-repeat="button in item.buttons">{{item.button.text}}</button>' +
|
||||
' </div>' +
|
||||
'</li>',
|
||||
link: function($scope, $element, $attr) {
|
||||
}
|
||||
}
|
||||
});
|
||||
*/
|
||||
})
|
||||
|
||||
.directive('listItems', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
scope: {
|
||||
isEditing: '=',
|
||||
items: '='
|
||||
},
|
||||
template: '<ul class="list" ng-class="{\'list-editing\': isEditing}">' +
|
||||
'<list-item ng-repeat="item in items" canDelete="item.canDelete" canSwipe="item.canSwipe">' +
|
||||
' {{item.text}}' +
|
||||
'</list-item>' +
|
||||
'</ul>',
|
||||
link: function($scope, $element, $attr) {
|
||||
var lv = new ionic.views.List({el: $element[0]});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user