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

Commit f0a129a

Browse files
bekospkozlowski-opensource
authored andcommittedJan 21, 2014
fix(alert): use interpolation for type attribute
Closes #1460 BREAKING CHANGE: Use interpolation for type attribute. Before: ```html <alert type="'info'" ...></alert > ``` or ```html <alert type="alert.type" ...></alert > ``` After: ```html <alert type="info" ...></alert > ``` or ```html <alert type="{{alert.type}}" ...></alert > ```
1 parent 2947a2d commit f0a129a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎src/alert/alert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ angular.module('ui.bootstrap.alert', [])
1212
transclude:true,
1313
replace:true,
1414
scope: {
15-
type: '=',
15+
type: '@',
1616
close: '&'
1717
}
1818
};

‎src/alert/docs/demo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div ng-controller="AlertDemoCtrl">
2-
<alert ng-repeat="alert in alerts" type="alert.type" close="closeAlert($index)">{{alert.msg}}</alert>
2+
<alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</alert>
33
<button class='btn btn-default' ng-click="addAlert()">Add Alert</button>
44
</div>

‎src/alert/test/alert.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('alert', function () {
1313

1414
element = angular.element(
1515
'<div>' +
16-
'<alert ng-repeat="alert in alerts" type="alert.type"' +
16+
'<alert ng-repeat="alert in alerts" type="{{alert.type}}"' +
1717
'close="removeAlert($index)">{{alert.msg}}' +
1818
'</alert>' +
1919
'</div>');
@@ -88,7 +88,7 @@ describe('alert', function () {
8888
});
8989

9090
it('should be possible to add additional classes for alert', function () {
91-
var element = $compile('<alert class="alert-block" type="\'info\'">Default alert!</alert>')(scope);
91+
var element = $compile('<alert class="alert-block" type="info">Default alert!</alert>')(scope);
9292
scope.$digest();
9393
expect(element).toHaveClass('alert-block');
9494
expect(element).toHaveClass('alert-info');

0 commit comments

Comments
 (0)