Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngMessages render adjustment #13009

Open
iherbak opened this issue Oct 5, 2015 · 7 comments
Open

ngMessages render adjustment #13009

iherbak opened this issue Oct 5, 2015 · 7 comments

Comments

@iherbak
Copy link

iherbak commented Oct 5, 2015

Hi!

Lately we were using the ngMessages with a decorator to show a backdrop on errors. With the new version the render method inside the directive controller is not easy to decorate with such business logic to decide if there is an error or not. Any way to solve this?

Suggestion is like to add a : return unmatchedMessages.length !== totalMessages; to the render method end. (angular-messages.js line 391)

@Narretz
Copy link
Contributor

Narretz commented Oct 5, 2015

Can you open a PR with this change and a corresponding test that shows what you want to accomplish?

@Narretz
Copy link
Contributor

Narretz commented Oct 5, 2015

Or as a plnkr.co

@iherbak
Copy link
Author

iherbak commented Oct 5, 2015

http://plnkr.co/edit/SmFu5bIsFXdg7gbmoGry

The goal is show a backdrop and pull the input in front of it to highlight were the user should correct. The plunkr is pretty basic but shows it. I'D like to reach it by decorating the ngMessages. In the earlier versions we decorated the renderElementClasses and used the bool parameter to determine if we have to show the backdrop or not. The current render class has a collection input parameter.

Thanks in advance.

@Narretz
Copy link
Contributor

Narretz commented Oct 5, 2015

So the current plnkr does not show what you actually want, but a workaround? Because I see no decorator.

@iherbak
Copy link
Author

iherbak commented Oct 6, 2015

Updated a plunkr with a decorator. I'd like to decorate the render function to show and hide the backdrop according to the render result. Hope it's better now. Thx

@Narretz Narretz added this to the Purgatory milestone Oct 8, 2015
@Narretz
Copy link
Contributor

Narretz commented Oct 8, 2015

Basically, what you want is some sort of flag that indicates if there is an error (message)? Or do you need to know exactly which messages are currently displayed?

@iherbak
Copy link
Author

iherbak commented Oct 8, 2015

Hi, I Just want a flag, thats all.

Thanks in advance

----- Eredeti üzenet -----
Feladó: "Martin Staffa" [email protected]
Feladva: ‎2015.‎10.‎08. 17:15
Címzett: "angular/angular.js" [email protected]
Másolat: "iherbak" [email protected]
Tárgy: Re: [angular.js] ngMessages render adjustment (#13009)

Basically, what you want is some sort of flag that indicates if there is an error (message)? Or do you need to know exactly which messages are currently displayed?

Reply to this email directly or view it on GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants