Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:38
    ArjunMohan008 starred angular/angular
  • Sep 24 23:31
    dgp1130 synchronize #43572
  • Sep 24 23:30
    dgp1130 ready_for_review #43572
  • Sep 24 23:29
    dgp1130 review_requested #43572
  • Sep 24 23:28
    dgp1130 review_requested #43572
  • Sep 24 23:28
    dgp1130 review_requested #43572
  • Sep 24 23:28
    dgp1130 labeled #43572
  • Sep 24 23:28
    dgp1130 edited #43572
  • Sep 24 23:24
    dgp1130 edited #43572
  • Sep 24 23:23
    dgp1130 synchronize #43572
  • Sep 24 23:15
    vwang4536 edited #43581
  • Sep 24 23:12
    vwang4536 opened #43581
  • Sep 24 23:11
    dgp1130 synchronize #43572
  • Sep 24 23:08
    IgorMinar commented #43506
  • Sep 24 23:00
    AndrewKushnir commented #43580
  • Sep 24 22:59
    google-cla[bot] labeled #43580
  • Sep 24 22:59
    ngbot[bot] milestoned #43580
  • Sep 24 22:59
    ngbot[bot] milestoned #43580
  • Sep 24 22:59
    ngbot[bot] milestoned #43580
  • Sep 24 22:59
    AndrewKushnir labeled #43580
Aishasadat123
@Aishasadat123
it just find thefacility with NPM type not add anything
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 Try facility['Type'] = 'NPM'; instead of facility.Type = 'NPM';
Aishasadat123
@Aishasadat123
not working
the result is same
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 Add:
if (!facility.Type) {
   // The element doesn't contain property of Type
   facility.Type = 'NPM';
   console.log('... adding Type property:', facility);
} else {
   console.log('... data type:', typeof facility.Type); // Would be a string data type
}
Aishasadat123
@Aishasadat123
@mlc-mlapis still same result
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 What is shown on the console for facility then?
Aishasadat123
@Aishasadat123
it show all facilities with type property
it does not make any change in the facility which does not has type property
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 I mean the result of: console.log('... adding Type property:', facility);
Aishasadat123
@Aishasadat123
... data type: string
... adding Type property
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 Nothing for both syntax: facility.Type = 'NPM'; or facility['Type'] = 'NPM';?
Aishasadat123
@Aishasadat123
it show this
for both show same result
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 console.log('... adding Type property:', facility); shows only ... adding Type property: and nothing for facility?
@Aishasadat123 Then print also:
const facility = facilities[i];
console.log('... original content:', facility);
Aishasadat123
@Aishasadat123
it show facilities
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 And after adding facility['Type'] = 'NPM'; it shows nothing?
Aishasadat123
@Aishasadat123
when i run the it also shows the facilities
i think i made you confused
can you please run it on your pc ?
if you want i will send the json file
ok?
Miloš Lapiš
@mlc-mlapis
OK. I can do it later. So put that JSON example here.
Aishasadat123
@Aishasadat123
ok
can i send in private message ?
santoshfurtado
@santoshfurtado

Hi Guys,

Could you please help me on the angular SSR with base ref deployment issue?
I am able to load the application without SSR with base ref but I am getting below issue with SSR & base href

Error : Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec

I have also tried setting the type to type="text/javascript" but it also throws Unexpected token <

01.png
02.png
Ashref
@Asher2016
hello , i have issue when router.navigate(['../']) doesn't work because i have object/iframe loading html page
so this the code
@Component 
turnBack(){
      this.router.navigate(['../'], {relativeTo: this.activatedRouter})
    }

@HTML
<object [data]="urlSafe" type="text/html"
        width="800" height="1200" typemustmatch>
</object>
WahidN
@WahidN
How can I intercept a route change?
jyoti singh
@jyotisingh144

I need to change parent's components heading as per child Component's heading through router outlet. How can I do that?

Sample structure
in parent Component.ts
title = ""

In parent Component.html
{{title}}

<router-outlet></router-outlet>

in child component.ts
title = "Login"

I want to get this child's component title in parent component

Ashref
@Asher2016
Guys , any advice how to add param to route when it change or leave the actual component ?
StephenS
@S-Stephen
Hi Everyone, I'm considering configuring a multi-project repo. I realise that the nx tools exist but wandered how far I can get with the standard angular-cli setup. Indeed I would rather not have to really on a further tool beyond angular cli. I've read that Angular CLI supports multi project repos :https://angular.io/guide/file-structure#multiple-projects. However I'm after information of how to configure build and test of these atomically (along with how to transition from a traditional angular CLI repo). I was wandering whether any of you friendly folk may have written an article on this (accessible if not registered on medium) or indeed have any tips?
Miloš Lapiš
@mlc-mlapis
@S-Stephen Most of such projects probably used Nx monorepo, which extended the original base used in CLI and add many new features.
StephenS
@S-Stephen
Thanks @mlc-mlapis any idea what the 'road map' is for Nx. Will I at some stage need a license etc?
Miloš Lapiš
@mlc-mlapis
@S-Stephen Start here https://nx.dev and it's free.
StephenS
@S-Stephen
@mlc-mlapis thanks that's where I am :-) at the moment I can't see anything that assures me it will be free in perpetuity :-(. pretty daunting atm, but I'll give it a go I guess!
Miloš Lapiš
@mlc-mlapis
@S-Stephen Maybe here https://nrwl.io/products
StephenS
@S-Stephen
ty @mlc-mlapis
Ghost
@ghost~5fa3e8c4d73408ce4ff35859
hi
Liveloper
@liveloper
hello, anybody knows how can i use jest and karma together in an angular project?
1 reply
mohammadzbggo
@mohammadzbggo
Hi how does the navigationExtras(Angular Router) work to receive updates? Let's say I have a route loaded with an initial state. After some time I receive updates from a backend source. How do the updates get transferred? We can talk about it from high-level perspective.
Miloš Lapiš
@mlc-mlapis
@mohammadzbggo How do you receive that update on a client side?
4 replies
mogo-edenpark
@mogo-edenpark

Hi, guys, how do I wait for functions?

async function warnDuplicateContainerNumber() {
                    let valid = true;
                    let legs = [];
                    $scope.model.legs.map(function (leg, index) {
                        return orderContainerCreateService.warnDuplicateContainerNumber(leg.containerNumber).then(function (response) {
                            if (response.status == 200) {
                                valid = response.data.valid;
                                if (!valid) {
                                    legs.push(index + 1);
                                }
                            }
                        });
                    });
                    await Promise.all(allPromise);
}

let needToWait = await warnDuplicateContainerNumber();

I need to wait all of that and need to use that value to do a certain procedure

Miloš Lapiš
@mlc-mlapis
@mogo-edenpark But async / await is about making an async operation to be a sync one.
Miloš Lapiš
@mlc-mlapis
@mogo-edenpark You have to respect the pattern:
async function a (...) {...}
async function b () {
   const result = await a(...);
   return result;
}
const result = b(...);