diff --git a/dist/ionic-angular.js b/dist/ionic-angular.js
index 679ecf6027..567725421d 100644
--- a/dist/ionic-angular.js
+++ b/dist/ionic-angular.js
@@ -87,7 +87,7 @@ angular.module('ionic.service.modal', ['ionic.service'])
var element = $compile(templateString)(scope);
$document[0].body.appendChild(element[0]);
- var modal = ionic.views.Modal({el: element[0] });
+ var modal = new ionic.views.Modal({el: element[0] });
scope.modal = modal;
return modal;
},
@@ -182,22 +182,6 @@ angular.module('ionic.ui.content', [])
;
angular.module('ionic.ui.list', ['ionic.service'])
-.directive('list', function() {
- return {
- restrict: 'E',
- replace: true,
- transclude: true,
- scope: {
- isEditing: '='
- },
- template: '
',
- link: function($scope, $element, $attr) {
- var lv = new ionic.views.List({el: $element[0]});
- }
- }
-})
-
-
.directive('listItem', function() {
return {
restrict: 'E',
@@ -218,10 +202,11 @@ angular.module('ionic.ui.list', ['ionic.service'])
}
})
-.directive('listItems', function() {
+.directive('list', function() {
return {
restrict: 'E',
replace: true,
+ transclude: true,
scope: {
isEditing: '=',
items: '='
@@ -229,10 +214,15 @@ angular.module('ionic.ui.list', ['ionic.service'])
template: '' +
'' +
' {{item.text}}' +
+ ' ' +
'' +
'
',
- link: function($scope, $element, $attr) {
- var lv = new ionic.views.List({el: $element[0]});
+ compile: function(element, attr, transclude) {
+ return function($scope, $element, $attr) {
+ var lv = new ionic.views.List({el: $element[0]});
+
+ $element.append(transclude($scope));
+ }
}
}
})
diff --git a/dist/ionic-ios7.css b/dist/ionic-ios7.css
index bfd2c7cd15..e678c6c001 100644
--- a/dist/ionic-ios7.css
+++ b/dist/ionic-ios7.css
@@ -1074,6 +1074,8 @@ a.list-item {
z-index: 1;
padding: 15px 15px;
-webkit-transition: left 0.2s ease-in-out; }
+ .list-item-content > i:last-child {
+ float: right; }
.list-item-edit {
position: absolute;
diff --git a/dist/ionic.css b/dist/ionic.css
index 0407edece5..99038b4791 100644
--- a/dist/ionic.css
+++ b/dist/ionic.css
@@ -1162,6 +1162,8 @@ a.list-item {
z-index: 1;
padding: 15px 15px;
-webkit-transition: left 0.2s ease-in-out; }
+ .list-item-content > i:last-child {
+ float: right; }
.list-item-edit {
position: absolute;
diff --git a/js/ext/angular/src/directive/ionicList.js b/js/ext/angular/src/directive/ionicList.js
index 9fb79357b5..761c294546 100644
--- a/js/ext/angular/src/directive/ionicList.js
+++ b/js/ext/angular/src/directive/ionicList.js
@@ -1,21 +1,5 @@
angular.module('ionic.ui.list', ['ionic.service'])
-.directive('list', function() {
- return {
- restrict: 'E',
- replace: true,
- transclude: true,
- scope: {
- isEditing: '='
- },
- template: '',
- link: function($scope, $element, $attr) {
- var lv = new ionic.views.List({el: $element[0]});
- }
- }
-})
-
-
.directive('listItem', function() {
return {
restrict: 'E',
@@ -36,10 +20,11 @@ angular.module('ionic.ui.list', ['ionic.service'])
}
})
-.directive('listItems', function() {
+.directive('list', function() {
return {
restrict: 'E',
replace: true,
+ transclude: true,
scope: {
isEditing: '=',
items: '='
@@ -47,10 +32,15 @@ angular.module('ionic.ui.list', ['ionic.service'])
template: '' +
'' +
' {{item.text}}' +
+ ' ' +
'' +
'
',
- link: function($scope, $element, $attr) {
- var lv = new ionic.views.List({el: $element[0]});
+ compile: function(element, attr, transclude) {
+ return function($scope, $element, $attr) {
+ var lv = new ionic.views.List({el: $element[0]});
+
+ $element.append(transclude($scope));
+ }
}
}
})
diff --git a/js/ext/angular/src/service/ionicModal.js b/js/ext/angular/src/service/ionicModal.js
index 8ebbd72f5d..ad94f6904b 100644
--- a/js/ext/angular/src/service/ionicModal.js
+++ b/js/ext/angular/src/service/ionicModal.js
@@ -17,7 +17,7 @@ angular.module('ionic.service.modal', ['ionic.service'])
var element = $compile(templateString)(scope);
$document[0].body.appendChild(element[0]);
- var modal = ionic.views.Modal({el: element[0] });
+ var modal = new ionic.views.Modal({el: element[0] });
scope.modal = modal;
return modal;
},
diff --git a/js/ext/angular/test/directive/ionicList.unit.js b/js/ext/angular/test/directive/ionicList.unit.js
new file mode 100644
index 0000000000..070b0b0b29
--- /dev/null
+++ b/js/ext/angular/test/directive/ionicList.unit.js
@@ -0,0 +1,11 @@
+describe('Ionic List', function() {
+ var modal, q;
+
+ beforeEach(module('ionic.ui.list'));
+
+ beforeEach(function() {
+ });
+
+ it('Should init', function() {
+ });
+});
diff --git a/js/ext/angular/test/list.html b/js/ext/angular/test/list.html
index 32ba8c529a..93d5a78f0f 100644
--- a/js/ext/angular/test/list.html
+++ b/js/ext/angular/test/list.html
@@ -73,8 +73,8 @@
-
-
+
+
@@ -84,14 +84,44 @@
angular.module('navTest', ['ionic.ui.list'])
.controller('TestCtrl', function($scope) {
- $scope.items = [{
- text: 'Item 1',
- canDelete: true,
- canSwipe: true,
- buttons: [{
- text: 'Kill'
- }]
- }];
+ $scope.items = [
+ {
+ text: 'Item 1',
+ canDelete: true,
+ canSwipe: true,
+ icon: 'icon-chevron-right',
+ buttons: [{
+ text: 'Kill'
+ }]
+ },
+ {
+ text: 'Item 2',
+ canDelete: true,
+ canSwipe: true,
+ icon: 'icon-chevron-right',
+ buttons: [{
+ text: 'Kill'
+ }]
+ },
+ {
+ text: 'Item 3',
+ canDelete: true,
+ canSwipe: true,
+ icon: 'icon-chevron-right',
+ buttons: [{
+ text: 'Kill'
+ }]
+ },
+ {
+ text: 'Item 4',
+ canDelete: true,
+ canSwipe: true,
+ icon: 'icon-chevron-right',
+ buttons: [{
+ text: 'Kill'
+ }]
+ }
+ ];
$scope.edit = function() {
$scope.isEditingItems = !$scope.isEditingItems;
}
diff --git a/js/ext/angular/test/service/ionicModal.unit.js b/js/ext/angular/test/service/ionicModal.unit.js
index 60b7fb8a87..438e6020fd 100644
--- a/js/ext/angular/test/service/ionicModal.unit.js
+++ b/js/ext/angular/test/service/ionicModal.unit.js
@@ -1,17 +1,38 @@
describe('Ionic Modal', function() {
var modal, q;
- beforeEach(module('ionic.ui.modal'));
+ beforeEach(module('ionic.service.modal'));
- beforeEach(inject(function(Modal, $q) {
+ beforeEach(inject(function(Modal, $q, $templateCache) {
q = $q;
modal = Modal;
+
+ $templateCache.put('modal.html', '');
}));
- iit('Should show', function() {
+ it('Should show for static template', function() {
var template = '';
- var deferred = q.defer();
- modal.fromTemplate(template);
- deferred.resolve(true);
+ var modalInstance = modal.fromTemplate(template);
+ modalInstance.show();
+ expect(modalInstance.el.classList.contains('modal')).toBe(true);
+ expect(modalInstance.el.classList.contains('active')).toBe(true);
+ });
+
+ iit('Should show for dynamic template', function() {
+ var template = '';
+
+ var done = false;
+
+ var modalInstance = modal.fromTemplateUrl('modal.html', function(modalInstance) {
+ done = true;
+ modalInstance.show();
+ expect(modalInstance.el.classList.contains('modal')).toBe(true);
+ expect(modalInstance.el.classList.contains('active')).toBe(true);
+ });
+
+ waitsFor(function() {
+ return done;
+ }, "Modal should be loaded", 100);
+
});
});
diff --git a/scss/ionic/_listview.scss b/scss/ionic/_listview.scss
index ffa77e54c0..3c8470bd8a 100644
--- a/scss/ionic/_listview.scss
+++ b/scss/ionic/_listview.scss
@@ -108,6 +108,11 @@ a.list-item {
padding: 15px 15px;
-webkit-transition: left 0.2s ease-in-out;
+
+ // Align icons to the right
+ > i:last-child {
+ float: right;
+ }
}
.list-item-edit {