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

Alert type expressions are ignored when applied in an event method (always shows warning-style) #2145

Closed
@olada

Description

@olada

I came across following issue, which I have recreated in following plunker: http://plnkr.co/edit/iKUc68725E7daDKKbGW6?p=preview

It shows a button which will trigger an alert.
The alert is customized by data coming from the controller.

When setting the data directly in the controller, the alert is customized just fine.
E.g.
$scope.alert = {type: "danger", message: "This is a danger-alert"};
shows a correct red alert box.

However, when the same object is created from inside the submit-method, only the text will be applied and the design of the alert box will be rendered using "warning"-style (yellow-ish).

Does this have something to do with the latest modifications to the scope of the alert template?
This has been driving me nuts for the few past hours (I have just started with Angular / ui-bootstrap).

Feel free to fiddle around with the plunker link and uncomment the first $scope.alert = { .... occurence while commenting the later one.

TLDR:
Alert-Markup using {{alert.message}} fails when the alert object is changed during a form-submit event, as it will always show type = warning, even though the generated markup shows traces of the correct type (contains class alert-danger within ng-class attribute)

I hope the issue is somewhat understandable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions