diff --git a/js/angular/directive/item.js b/js/angular/directive/item.js index dd2bccfd728..29e9092740c 100644 --- a/js/angular/directive/item.js +++ b/js/angular/directive/item.js @@ -37,7 +37,9 @@ function($animate, $compile) { }], scope: true, compile: function($element, $attrs) { - var isAnchor = angular.isDefined($attrs.href) || angular.isDefined($attrs.ngHref); + var isAnchor = angular.isDefined($attrs.href) || + angular.isDefined($attrs.ngHref) || + angular.isDefined($attrs.uiSref); var isComplexItem = isAnchor || //Lame way of testing, but we have to know at compile what to do with the element /ion-(delete|option|reorder)-button/i.test($element.html()); diff --git a/test/unit/angular/directive/list.unit.js b/test/unit/angular/directive/list.unit.js index 250b8ca3afa..5121504c935 100644 --- a/test/unit/angular/directive/list.unit.js +++ b/test/unit/angular/directive/list.unit.js @@ -245,6 +245,12 @@ describe('ionItem directive', function() { expect(el.hasClass('item')).toBe(true); expect(el.hasClass('item-complex')).toBe(false); }); + it('should be complex if ui-sref', function() { + var el = setup('ui-sref="something"'); + expect(el.hasClass('item item-complex')).toBe(true); + expect(el.children()[0].tagName).toBe('A'); + expect(el.children().hasClass('item-content')).toBe(true); + }); ['href', 'ng-href'].forEach(function(attr) { it('should be complex anchor if '+attr+' is defined', function() { var el = setup(attr+'="something/{{foo}}"');