Giter VIP home page Giter VIP logo

Comments (4)

armanozak avatar armanozak commented on June 2, 2024 2

Hi @begandroide,

targetSelector is passed to InjectionToken as value and is being processed here:

? this.elRef.nativeElement.closest(this.targetSelector)

I have forked the demo app, upgraded it to Angular 9 and changed the targetSelector to .form-control:

https://stackblitz.com/edit/ngx-validate-c6biws?file=src%2Fapp%2Fapp.module.ts

As you can see, a solid border replaces the dashed border. This is because, is-invalid class is placed on the form control instead of the form group. You can see the styling here:

https://stackblitz.com/edit/ngx-validate-c6biws?file=src%2Fstyles.css

If you set targetSelector back to .form-group, the dashed border will return.

Please let me know if this answer is clear to you.

P.S. Ivy is not enabled in the demo, because explicit generic type for ModuleWithProviders is not applied in this library yet and that is a breaking change when Ivy is enabled.

from ngx-validate.

armanozak avatar armanozak commented on June 2, 2024 1

I think placing validationTarget on div.mat-form-field-wrapper should insert the error component exactly where you wish it to be.

Sorry for missing documentation and features. We have not been able to invest our time in this repo so far, but we intend to do so very soon.

from ngx-validate.

begandroide avatar begandroide commented on June 2, 2024 1

Thank you very much !! works for me 😄

from ngx-validate.

begandroide avatar begandroide commented on June 2, 2024

Hi @armanozak, thanks you very much for the quick response. I understood that is-invalid class is placed on the targetSelector, thanks for that. Now the principal problem is that i want place the custom component in a special place (below class mat-form-field-flex), and the custom error component still placing below of invalid target.
image

image

from ngx-validate.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.