Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:54
    nithin8790 starred angular/angular
  • 03:04
    pullapprove[bot] review_requested #41757
  • 03:04
    google-cla[bot] labeled #41757
  • 03:04
    smdunn809 opened #41757
  • 03:01
    nuonuoge commented #41506
  • 03:01
    nuonuoge commented #41506
  • 02:59
    nuonuoge commented #41506
  • 02:55
    nuonuoge commented #41506
  • 02:53
    smdunn809 opened #41756
  • 02:49
    nuonuoge commented #41506
  • 02:28
    AndrewKushnir commented #41358
  • 02:25
    nuonuoge commented #41506
  • 02:25
    nuonuoge commented #41506
  • 02:24
    nuonuoge commented #41506
  • 02:00
    dayvesoliveira starred angular/angular
  • 01:42
    andrewasche synchronize #41632
  • 00:45
    kaworuist starred angular/angular
  • 00:40
    JiaLiPassion commented #41506
  • 00:33
    JiaLiPassion assigned #41506
kelly
@kellyprankin
Thanks :)
choubani amir
@amirensit

hello.
Any explanation about this return type:

createDb() {
    const heroes = [
      { id: 11, name: 'Dr Nice' },
      { id: 12, name: 'Narco' },
      { id: 13, name: 'Bombasto' },
      { id: 14, name: 'Celeritas' },
      { id: 15, name: 'Magneta' },
      { id: 16, name: 'RubberMan' },
      { id: 17, name: 'Dynama' },
      { id: 18, name: 'Dr IQ' },
      { id: 19, name: 'Magma' },
      { id: 20, name: 'Tornado' }
    ];
    return {heroes};
  }

Is it the equivalent of:

return {'heroes': heroes}

What is called this syntax ?

ishu mishra
@coderishu
Hi Folks
folks
  <ng-sidebar-container
    class="ng-sidebar-container"
    id="WidgetDateRange"
    style="display: contents"
    [style.visibility]="_WidgetDateRangeOpened ? 'visible' : 'hidden'"
  >
this visibility is working in chrome but not working in IE(asked by client to do)
tried display:none,block but not working
even tried opacity
Ikenna Okafor
@bot101
@coderishu, I have had this issue sometimes in the past but can't seem to remember how I fixed it. I think you need to set a height on ng-sidebar, not very sure.
ishu mishra
@coderishu
ah ! ok
Ikenna Okafor
@bot101
Just confirmed, you need to set a height on <ng-sidebar-container
ishu mishra
@coderishu
thats great let me check
Xava\du
@xavadu_twitter
how do you escape the &shy; (soft hypen) in the translation? I can not find a way to do it and I have the error [xmldom error] entity not found:&shy; for what I see could be a parser issue
oh, I see is an error of xliffmerge and not angular
Jorrit
@jorrit-wehelp
@xavadu_twitter I'd suggest just using the actual unicode character instead, without escaping. But if you must, would need numeric escape , so decimal or hex
Xava\du
@xavadu_twitter

@jorrit-wehelp the unicode is not rendering in HTML, I am just doing a test and the extraction tool of angular just remove it

in html
<div i18n="@@test">:provider_count Anbieter gefunden für Über&shy;weisungen &amp;zwischen :to_country_name und :from_country_name. Jetzt vergleichen</div>

generated xlf translation:
<source>:provider_count Anbieter gefunden für Über­weisungen &amp;zwischen :to_country_name und :from_country_name. Jetzt vergleichen</source>

strange

BTW the &shy; is an invisible character that say where a word can be break
Shaik Irfan
@Irfan354
hi there
am a beginner for angular
iam trying to execute a project
but am stucked at scripting
how to code the value that my app can run
if anyone can guide me for javascript and typescript how to do coding
itll be helpful
Xava\du
@xavadu_twitter
@Irfan354 follow the Angular tutorial to start https://angular.io/tutorial
cuznerdexter
@cuznerdexter

Hi, I have an issue with ViewContainers.
I have a custom structural directive = eg “permissionAccess" it selects data from my NGRX store and looks for matching permissions.
If no permission it clears the ViewContainer,
If has permission if Rebuilds the ViewContainer using the injected TemplateRef
(This all works fine - I have tested with Dom elements, Components, Views)
But… it fails to rebuild the ViewContainer if any of the Dom contains
ngIf directives.
Anyone know why this would happen?? I have no idea!
It even fails with the "*ngIf=“true”"

Template Example Works:

<div *cwbPermission=“'ADMIN'">
        <p>test container</p>
        <div>
          <p>Nested container1</p>
          <div>
            <p>Nested container2</p>
          </div>
        </div>
      </div>

Template Example Fails:

<div *cwbPermission=“'ADMIN'">
        <p>test container</p>
        <div *ngIf=“true">
          <p>Nested container1</p>
          <div>
            <p>Nested container2</p>
          </div>
        </div>
      </div>
cuznerdexter
@cuznerdexter
So, I am not sure if this the best approach to this issue but looks like it is working for me. I added a changeDetectorRef.detectChanges() after creating the template in the view container and the UI now updates as I expect. Not seen any issues so far.
 /**
  * Creates the template content
  */
  showContent(): void {
    this.viewContainer.remove();
    this.viewContainer.createEmbeddedView(this.templateRef, this.context, 0);
    this.cdref.detectChanges();
  }
itsmenabil
@itsmenabil
hey guys, im new to this, can anyone please help me solve this code so i can join codewars
function multiply(a , b){
a * b
}
mogo-edenpark
@mogo-edenpark
function multiply(a , b){
   return a * b;


}
@itsmenabil
nunobotelhokk
@nunobotelhokk
I'm having some issues validating a form control. I'm setting this as a validator:
[
                Validators.required,
                Validators.minLength(9),
                Validators.maxLength(32)
        ]
But it only gives me the required error
If i remove the required, the control is always valid...
any idea on what i'm missing?
I have exactly the same validation on another place and it works fine.
mogo-edenpark
@mogo-edenpark
this.userForm = this.userFB.group({
            username: [
                "",
                Validators.compose([
                    Validators.required,
                    Validators.minLength(3),
                    Validators.maxLength(200),
                ]),
            ],
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..