Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(alert): use interpolation for type attribute #1460

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ angular.module('ui.bootstrap.alert', [])
transclude:true,
replace:true,
scope: {
type: '=',
type: '@',
close: '&'
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/alert/docs/demo.html
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 2 additions & 2 deletions src/alert/test/alert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>');
Expand Down Expand Up @@ -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');
Expand Down