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

Commit

Permalink
fix(alert): use interpolation for type attribute
Browse files Browse the repository at this point in the history
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 >
  ```
  • Loading branch information
bekos authored and pkozlowski-opensource committed Jan 21, 2014
1 parent 2947a2d commit f0a129a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit f0a129a

Please sign in to comment.