-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(alert): change API due to the introduction of animations
BREAKING CHANGE: Alert closing API has changed due to the introduction of the imperative `.close()` method to trigger the 'fade out' animation Before: ``` <ngb-alert (close)="..."></ngb-alert> ``` After: ``` // template <ngb-alert (closed)="..."></ngb-alert> // component alert.close(); ``` The `closed` event is emitted after the 'fade out' animation is finished. The 'fade out' animation can be triggered either by clicking on the alert's 'cross button' or calling `.close()` method.
- Loading branch information
1 parent
22ddad7
commit 95f75cc
Showing
4 changed files
with
42 additions
and
11 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
demo/src/app/components/alert/demos/closeable/alert-closeable.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<p> | ||
Static self-closing alert that disappears after 20 seconds (refresh the page if it has already disappeared) | ||
</p> | ||
<ngb-alert #staticAlert *ngIf="!staticAlertClosed" (close)="staticAlertClosed = true">Check out our awesome new | ||
<ngb-alert #staticAlert *ngIf="!staticAlertClosed" (closed)="staticAlertClosed = true">Check out our awesome new | ||
features!</ngb-alert> | ||
|
||
<hr /> | ||
|
||
<p> | ||
Show a self-closing success message that disappears after 5 seconds. | ||
</p> | ||
<ngb-alert #selfClosingAlert *ngIf="successMessage" type="success" (close)="successMessage = ''">{{ successMessage }} | ||
<ngb-alert #selfClosingAlert *ngIf="successMessage" type="success" (closed)="successMessage = ''">{{ successMessage }} | ||
</ngb-alert> | ||
<p> | ||
<button class="btn btn-primary" (click)="changeSuccessMessage()">Change message</button> | ||
</p> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters