Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:18
    ngbot[bot] milestoned #41020
  • 20:18
    zarend labeled #41020
  • 20:14
    ngbot[bot] milestoned #41021
  • 20:14
    zarend labeled #41021
  • 20:12
    IgorMinar commented #41021
  • 20:04
    zarend closed #23856
  • 20:04
    zarend closed #40663
  • 20:04

    zarend on master

    fix(common): allow number or bo… (compare)

  • 20:02
    ibra4 starred angular/angular
  • 20:01
    zarend unlabeled #41020
  • 20:01
    zarend labeled #41020
  • 20:01
    zarend commented #41020
  • 20:01
    zarend commented #40987
  • 20:01
    zarend commented #40987
  • 19:58
    alxhub labeled #41021
  • 19:58
    alxhub labeled #41021
  • 19:58
    alxhub review_requested #41021
  • 19:58
    google-cla[bot] labeled #41021
  • 19:58
    alxhub opened #41021
  • 19:50
    aikidave review_requested #39938
nunobotelhokk
@nunobotelhokk
I tried that, no luck.
mogo-edenpark
@mogo-edenpark
<mat-error
                                                    *ngIf="
                                                        isControlHasError(
                                                            'roles',
                                                            'required'
                                                        )
                                                    "
                                                >
                                                    <strong>{{

                                                        "AUTH.VALIDATION.REQUIRED_FIELD"
                                                            | translate
                                                    }}</strong>
                                                </mat-error>
    isControlHasError(controlName: string, validationType: string): boolean {
        const control = this.userForm.controls[controlName];

        if (!control) {
            return false;
        }
        const result =
            control.hasError(validationType) &&
            (control.dirty || control.touched);
        return result;
    }
This will solve
nunobotelhokk
@nunobotelhokk
But why do i need to do that? This isnt even a tricky validation to be done
mogo-edenpark
@mogo-edenpark
I think you need a setting or something to my knowledge
in the doc they are still doing manually like this
<div *ngIf="heroForm.errors?.identityRevealed && (heroForm.touched || heroForm.dirty)" class="cross-validation-error-message alert alert-danger">
    Name cannot match alter ego.
</div>
like this.. That's all I know
Daniel Willis
@danww
@nunobotelhokk Can you reproduce in a Stackblitz instance?
mogo-edenpark
@mogo-edenpark
required is showing error because input has a property for required but not the length
nunobotelhokk
@nunobotelhokk
@danww its actually hard to reproduce, since i have this control on different forms. In one form he does validate correctly, in the other he doesnt. I'm not sure if i need to provide anything on the related module
Actually, they belong to the same module..
Daniel Willis
@danww
@nunobotelhokk K. It's just difficult to see the context without a working code example.
@nunobotelhokk And sometimes just the process of reproducing an issue in a Stackblitz means the solution becomes clear.
nunobotelhokk
@nunobotelhokk
Yup, ill try there.
nunobotelhokk
@nunobotelhokk
Thats it
But i dont think i'm doing anything different :joy:
Yup, found it
it seems that i cannot give it the input type of number...
Fkin hell...
Daniel Willis
@danww
So you can't validate minLength and maxLength on input with type="number"?
nunobotelhokk
@nunobotelhokk
It's the only thing i've changed, so i assume thats the issue with it
For number types, we should use min and max, and never minLength or maxLength
Validators.min(10000000000), Validators.max(999999999999)]
Should do something like that instead
Daniel Willis
@danww
:thumbsup:
That's good to know
I'm pleased you figured it out! :)
nunobotelhokk
@nunobotelhokk
Ye, it was messing with my head
Thanks for the help
Daniel Willis
@danww
No problem. I know it often seems like a lot of work and a real pain in the a**, but making a Stackblitz of the problem is such a helpful thing to do.
nunobotelhokk
@nunobotelhokk
Indeed.
FazilSog
@FazilSog

hello everybody
I m beginer on Angular generally & 8 specifically

So I cloned a git project et than I launched an npm install tu get back all projet dependencies

and after that I installedangular with npm install -g @angular/cli@8.1.3

Finally I lauched the server with ng serve -o

var code = "formatted";
this is the compilation erros that I'v got
(shift+enter for line break) var code = "formatted";
FazilSog
@FazilSog
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
 10% building 3/3 modules 0 activei 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
iwds」: webpack output is served from /   
iwds」: 404s will fallback to //index.html

chunk {main} main.js, main.js.map (main) 1.99 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 122 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 3.47 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 339 kB [initial] [rendered]
Date: 2021-01-20T21:46:10.345Z - Hash: d7587d01caf91f2a36ea - Time: 20540ms

ERROR in src/app/accueil/components/connection/connection.component.ts:9:36 - error TS2307: Cannot find module 'src/ws-contrat/target/generated-sources/annabel-be/strict-http-response'.

9 import { StrictHttpResponse } from 'src/ws-contrat/target/generated-sources/annabel-be/strict-http-response';
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/activation-mdp/components/donneespersonnelles/donneespersonnelles.component.ts:10:28 - error TS2307: Cannot find module 'src/ws-contrat/target/generated-sources/annabel-be/services/ods.service'.

10 import { OdsService } from 'src/ws-contrat/target/generated-sources/annabel-be/services/ods.service';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
please help I need your help
mogo-edenpark
@mogo-edenpark
General question guys.
git checkout master
git merge new-feature
git branch -d new-feature
as you see why do they delete new features after merging it? it's from Atlassian doc
Miloš Lapiš
@mlc-mlapis
@mogo-edenpark Because the feature is finished and incorporated into the master.
Famous
@famousmighodaro
Refused to load the image 'http://localhost:8100/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

Refused to load the font '<URL>' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'font-src' was not explicitly set, so 'default-src' is used as a fallback.
Please help, I got this error from browser console after I ng add angular-calendar. Now my code do not work a again
Syed Abdul Aala
@syedabdulaala
I have two component and each component have their own service instance which I achieved by providing provider in component decorator. Now I have a requirement where I have to create one component dynamically using component factory resolver but I don't want component to create the instance but instead use then value I have provided, I tried to achieve this by override the the injector like in code snippet below, but it's not working, it is always creating new service instance
const resolver = this.componentFactoryResolver.resolveComponentFactory( MultipleChoiceComponent ); const injector = Injector.create({ parent: this.injector, providers: [ { provide: MultipleChoiceService, useValue: this.dataEntryService.multipleChoiceService } ] }); this.dynTypeHost.createComponent(resolver, 0, injector);
Kamran Bahadori
@bahadorik
Hi all, I have a challenging problem, I have n angular2 (10) projects developed separately. To avoid performance problems, duplicated dependencies etc. I would like to make a single build as if it were a single project, but I don't want to drastically change the structure of these projects for example by creating sub-projects. do you think Module Federation could solve this problem? Anyone have any suggestions / experience?
Miloš Lapiš
@mlc-mlapis
@famousmighodaro It's somehow related to Content-Security-Policy (CSP), so what do you in <meta http-equiv="Content-Security-Policy" ... >
https://developers.google.com/web/fundamentals/security/csp
Miloš Lapiš
@mlc-mlapis
@syedabdulaala You would need to use probably useFactory (you have deps options) on a component level to set the providers more dynamically.