diff --git a/src/alert/alert.js b/src/alert/alert.js index e21b0cb889..658878b691 100644 --- a/src/alert/alert.js +++ b/src/alert/alert.js @@ -12,7 +12,7 @@ angular.module('ui.bootstrap.alert', []) transclude:true, replace:true, scope: { - type: '=', + type: '@', close: '&' } }; diff --git a/src/alert/docs/demo.html b/src/alert/docs/demo.html index 0e3b6d23d5..ec314447d4 100644 --- a/src/alert/docs/demo.html +++ b/src/alert/docs/demo.html @@ -1,4 +1,4 @@ <div ng-controller="AlertDemoCtrl"> - <alert ng-repeat="alert in alerts" type="alert.type" close="closeAlert($index)">{{alert.msg}}</alert> + <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</alert> <button class='btn btn-default' ng-click="addAlert()">Add Alert</button> </div> diff --git a/src/alert/test/alert.spec.js b/src/alert/test/alert.spec.js index 7155b36036..4d2aba7ef0 100644 --- a/src/alert/test/alert.spec.js +++ b/src/alert/test/alert.spec.js @@ -13,7 +13,7 @@ describe('alert', function () { element = angular.element( '<div>' + - '<alert ng-repeat="alert in alerts" type="alert.type"' + + '<alert ng-repeat="alert in alerts" type="{{alert.type}}"' + 'close="removeAlert($index)">{{alert.msg}}' + '</alert>' + '</div>'); @@ -88,7 +88,7 @@ describe('alert', function () { }); it('should be possible to add additional classes for alert', function () { - var element = $compile('<alert class="alert-block" type="\'info\'">Default alert!</alert>')(scope); + var element = $compile('<alert class="alert-block" type="info">Default alert!</alert>')(scope); scope.$digest(); expect(element).toHaveClass('alert-block'); expect(element).toHaveClass('alert-info');