diff --git a/js/angular/directive/item.js b/js/angular/directive/item.js index 3f0d52412e..1a44bf4328 100644 --- a/js/angular/directive/item.js +++ b/js/angular/directive/item.js @@ -42,7 +42,7 @@ function($animate, $compile) { var isAnchor = angular.isDefined($attrs.href) || angular.isDefined($attrs.ngHref); 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/.test($element.html()); + /ion-(delete|option|reorder)-button/i.test($element.html()); if (isComplexItem) { var innerElement = angular.element(isAnchor ? ITEM_TPL_CONTENT_ANCHOR : ITEM_TPL_CONTENT); diff --git a/test/unit/angular/directive/list.unit.js b/test/unit/angular/directive/list.unit.js index 99302a4f38..4dad39b0d2 100644 --- a/test/unit/angular/directive/list.unit.js +++ b/test/unit/angular/directive/list.unit.js @@ -235,11 +235,13 @@ describe('ionItem directive', function() { }); ['href', 'ng-href'].forEach(function(attr) { it('should be complex anchor if '+attr+' is defined', function() { - var el = setup(attr+'="something"'); + var el = setup(attr+'="something/{{foo}}"'); expect(el.hasClass('item item-complex')).toBe(true); expect(el.children()[0].tagName).toBe('A'); expect(el.children().hasClass('item-content')).toBe(true); - expect(el.children().attr('ng-href')).toBe('something'); + expect(el.children().attr('href')).toBe('something/'); + el.scope().$apply('foo = 44'); + expect(el.children().attr('href')).toBe('something/44'); }); }); ['ion-option-button','ion-reorder-button','ion-delete-button'].forEach(function(tag) {