Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding how to present the user with the ng-message #14

Open
peturh opened this issue Feb 11, 2016 · 4 comments
Open

Understanding how to present the user with the ng-message #14

peturh opened this issue Feb 11, 2016 · 4 comments

Comments

@peturh
Copy link

peturh commented Feb 11, 2016

I'm trying to present the user with the error messages below the input fields, just as they do with the bootstrap schema form. But I'm unable to understand this. I can see that we have something called sf-messages on the elements, but how do I populate them?

@Anthropic
Copy link
Member

They will populate just like the bootstrap ones do, there have just been changes in the way AM handles them so I need to do some updates, but the builder essentially uses sf-messages to append the block to each element so we only have to edit it in one spot.

@peturh
Copy link
Author

peturh commented Feb 12, 2016

    function sfMessagesBuilder(args) {
      var messagesDiv = args.fieldFrag.querySelector('[sf-messages]');
      if (messagesDiv && sfMessagesNode) {
        var child = sfMessagesNode.cloneNode();
        messagesDiv.appendChild(child);
      }
    };

This is the builder function your talking about?

@Anthropic
Copy link
Member

Yes that's it, but it adds in code that David put in to override the way AM works by default to keep it compatible. There are LOTS of bugs in AM still, so it is hard to implement, however it looks to be starting to stabilise at least api-wise so I will start working on it more very soon.

@DennisHalmstad
Copy link
Contributor

made some test and changes in the ng-message branch it works (needs work) but needs angular dependencies to be 1.4.8

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

No branches or pull requests

3 participants