Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:01
    AndrewKushnir commented #42140
  • 04:59
    AndrewKushnir labeled #42140
  • 04:59
    ngbot[bot] milestoned #42140
  • 04:59
    ngbot[bot] milestoned #42140
  • 04:59
    AndrewKushnir labeled #42140
  • 04:59
    AndrewKushnir labeled #42140
  • 04:59
    AndrewKushnir labeled #42140
  • 04:59
    pullapprove[bot] review_requested #42140
  • 04:58
    AndrewKushnir review_request_removed #42140
  • 04:48
    AnkitVNTT opened #42141
  • 04:46
    mary-poppins commented #42046
  • 04:34
    iRealNirmal synchronize #42046
  • 04:27
    zijianhuang commented #41897
  • 04:23
    Bhuvn1294 starred angular/angular
  • 03:40
    Javier747Belbruno starred angular/angular
  • 03:39
    vthinkxie edited #42126
  • 03:38
    vthinkxie commented #42126
  • 03:38
    vthinkxie commented #42126
  • 03:38
    vthinkxie commented #42126
Yosi
@yosiasz
@danww I used assessments instead of users , sorry
Daniel Willis
@danww
@yosiasz I'm still not seeing any data or routing in your Stackblitz example. Is this purely a layout issue? Or are you trying to get data into certain components?
Yosi
@yosiasz
Just layout issues
I just want to see the assessment screen in that location, i can mock up the data for now
Daniel Willis
@danww
@yosiasz Ah yep, I get it now.
@yosiasz Have you considered using @angular/flex-layout for layout?
Yosi
@yosiasz
Sure, anything that makes things better
I've forked your example, and used FlexLayout.
I didn't want to sift through the CSS in your template html, so just took out enough to make it work for the example.
Yosi
@yosiasz
no worries! so, flex instead of angular material or in addition to... thanks much
Yosi
@yosiasz
ok, in addition to. need to read up some more on flex
Daniel Willis
@danww
Yep, @angular/flex-layout works well with @angular/material
Yosi
@yosiasz
:thumbsup:
Daniel Willis
@danww
The docs for it aren't amazing, but it's a great tool, and using it with @angular/material means you barely have to write any CSS. :)
Yosi
@yosiasz
I can even build the menu in the navbar dynamically based on result from an api, based on username
Aladin Bensassi
@BenSassiAladin_twitter
Hey
Was wondering how I can change this into a link
<span ng-bind-html="vm.footer.info.web | linky:'_blank'"></span>
Tried a few things but nothing work
Basically, the problem is that if my user types in link.com instead of www.link.com the address stop behaving like a link and becomes just text
robert-brower-impaq
@robert-brower-impaq
@BenSassiAladin_twitter routerLink directive
click handler and this.router.navigate
or just use an anchor tag
Aishasadat123
@Aishasadat123
how can read a json object and manipuate it ?
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 There is a simple transformation from JSON to JS object, like const jsObject = {propA: 1, propB: 2, ...};
Aishasadat123
@Aishasadat123

{
"facilityName": {
"name": "ODK"

    },
    "FacilityCode": "300",
    "Type": "NPM",
    "facilityType": {
        "english": "Regional",
        "dari": " ملی",
        "pashto": "سیمه ایز"
    }


},
{

"facilityName": {
"name": "POI"
},
"FacilityCode": "300",

"facilityType": {
"english": "Regional",
"dari": " ملی",
"pashto": "سیمه ایز"
}
}

like in the i json objects i want to check if there is no type it iadd type
Miloš Lapiš
@mlc-mlapis

like in the i json objects i want to check if there is no type it iadd type

Can you re-formulate the sentence for better understanding?

Aishasadat123
@Aishasadat123
@mlc-mlapis how i can format it ?
Miloš Lapiš
@mlc-mlapis
image.png
Aishasadat123
@Aishasadat123
var code = "formatted"; {
"facilityName": {
"name": "ODK"
},
"FacilityCode": "300",
"Type": "NPM",
"facilityType": {
"english": "Regional",
"dari": " ملی",
"pashto": "سیمه ایز"
}
},
{
"facilityName": {
"name": "POI"
},
"FacilityCode": "300",
"facilityType": {
"english": "Regional",
"dari": " ملی",
"pashto": "سیمه ایز"
}
}
Miloš Lapiš
@mlc-mlapis
image.png
Aishasadat123
@Aishasadat123
@mlc-mlapis it does not work for me
Miloš Lapiš
@mlc-mlapis
Do you have a problem with entering 3 back-ticks on separate lines?
It works, you can be sure.
Aishasadat123
@Aishasadat123
{
    "facilityName": {
        "name": "ODK"
    },
    "FacilityCode": "300",
    "Type": "NPM",
    "facilityType": {
        "english": "Regional",
        "dari": " ملی",
        "pashto": "سیمه ایز"
    }
},
{
    "facilityName": {
        "name": "POI"
    },
    "FacilityCode": "300",
    "facilityType": {
        "english": "Regional",
        "dari": " ملی",
        "pashto": "سیمه ایز"
    }
in this json object i want if there is no type property it sould add
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 Done finally. :thumbsup:
Aishasadat123
@Aishasadat123
@mlc-mlapis yes
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 Do you mean that you want to find out somehow if there is a property called add in any nested level?
Aishasadat123
@Aishasadat123
@mlc-mlapis yes i want to check each object if there is not type it add the type property
Aishasadat123
@Aishasadat123
in above code the first object has type property but the secound does not
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 So it's just JS thing, not Angular specific. A method of how to do it depends on the number of different combinations where add property can be placed. If it is a concrete place use a standard addressing path and either get the property or you get undefined. Otherwise use probably RegExp for searching.
Aishasadat123
@Aishasadat123
@mlc-mlapis ok
Miloš Lapiš
@mlc-mlapis
@Aishasadat123 Or go through the array in a cycle (for (...)) and simple check if the current element has Type property.
Aishasadat123
@Aishasadat123
'use strict';

const fs = require('fs');

fs.readFile('facility.json', (err, data) => {
    if (err) throw err;
    let facility = JSON.parse(data);
    console.log(facility);
});

let data = JSON.stringify(facility);
fs.writeFileSync('facility-2.json', data);
@mlc-mlapis in this code where i apply the for loop?
Miloš Lapiš
@mlc-mlapis
let facility = JSON.parse(data); // Your code line
for (let i = 0; i < facility.length; i++) {
   const element = facility[i];
   if (!element.Type) {
      // The element doesn't contain property of Type
   }
}
Aishasadat123
@Aishasadat123
@mlc-mlapis please edit my code