From 38c246cf055b8bd92dc69fc6485e87ff6a0e1eb6 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Mon, 5 May 2014 00:25:05 -0700 Subject: [PATCH] fix(alert): correct binding of alert type class Regression from #1745 as there's a double interpolation expected but ngClass doesn't support that. The attribute value of ngClass is only interpolated once and the interpolated expression is watched. Fixes #2145 --- src/alert/test/alert.spec.js | 10 ++++++++++ template/alert/alert.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/alert/test/alert.spec.js b/src/alert/test/alert.spec.js index afdd824a45..fa0b4fb619 100644 --- a/src/alert/test/alert.spec.js +++ b/src/alert/test/alert.spec.js @@ -50,6 +50,16 @@ describe('alert', function () { expect(alerts.eq(2)).toHaveClass('alert-warning'); }); + it('should respect alert type binding', function () { + var alerts = createAlerts(); + expect(alerts.eq(0)).toHaveClass('alert-success'); + + scope.alerts[0].type = 'error'; + scope.$digest(); + + expect(alerts.eq(0)).toHaveClass('alert-error'); + }); + it('should show the alert content', function() { var alerts = createAlerts(); diff --git a/template/alert/alert.html b/template/alert/alert.html index 70ebd07618..8e28d6968c 100644 --- a/template/alert/alert.html +++ b/template/alert/alert.html @@ -1,4 +1,4 @@ -