Angular 8 Lazy Loading Syntax Not Working

I’m trying to implement Lazy loading into my Angular 8 application but when I use the syntax provided in the official doc, my module gets loaded eagerly.

When I use the syntax that comes with angular 8:

const routes: Routes = [{
  path: 'lazy',
  // The new import() syntax
  loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule)
}];

I get no error but I don’t get a new chunk when I build the app, and when navigationg to the module route, nothing appears in the Network tab of chrome. (Although I can navigate to the module just fine)

But if I rewrite it to:

const routes: Routes = [{
  path: 'lazy',
  // The following string syntax for loadChildren is deprecated
  loadChildren: './lazy/lazy.module#LazyModule'
}];

(which is the old syntax)
it works fine.

The module in question is definitely not imported anywhere else, the difference in result comes only from changing the syntax.

I’d like to know if there is something I’m missing there. I’m thinking maybe it’s my Angular that isn’t correctly set up to version 8 (or some other package)
So here’s what I have with a ng version:

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.4
@angular-devkit/build-angular     0.800.4
@angular-devkit/build-optimizer   0.800.4
@angular-devkit/build-webpack     0.800.4
@angular-devkit/core              8.0.4
@angular-devkit/schematics        8.0.4
@angular/cdk                      8.0.0
@angular/cli                      8.0.4
@angular/material                 8.0.0
@ngtools/webpack                  8.0.4
@schematics/angular               8.0.4
@schematics/update                0.800.4
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

read more

The Falcon Heavy rocket launched early Tuesday—two cores made it back safely

  • That’s the center core of the Falcon Heavy rocket just missing the drone ship. [credit:
    SpaceX webcast ]

2:50am ET Tuesday Update: SpaceX’s Falcon Heavy rocket launched at 2:30am ET on Tuesday morning, sending its payload of 24 satellites into space. Less than three minutes after the launch, the rocket’s two side-mounted boosters separated from the first stage’s center core, and subsequently returned to make a safe landing near Kennedy Space Center in Florida.

read more

How to make values show up in input boxes

This is my first time coding, and I’m trying to create a feature on my website where after I select an item from the dropdown menu, values corresponding to that item will show up in the input boxes I created. An example is if I select “apples” from my dropdown menu, the values “1.2” and “4.00” will show up in the “Pounds” and “Cost” input boxes respectively.

I already have code written using HTML and JS for the dropdown menu and input boxes, and I have stored the data corresponding to the items in a csv file. Right now, values show up in the input boxes only because I wrote code for that in JS. Is there any way for the HTML file to read my data from a csv file and display that data in my input boxes? Below is what I have so far.

<div id="cs-element">
  <label id="cs-element-label">Elements</label>
</div>

<select onChange="dropdownTip(this.value)" name="search_type" style="margin-right:10px; margin-top:2px;">
 <option selected="selected">Choose Element</option>
 <option>Methane</option>
 <option>Ethane</option>
 <option>Propane</option>
 <option>n-Butane</option>
</select>

<div id="result"></div>

<script type="text/javascript">
 function dropdownTip(value){
   console.log(value);
    document.getElementById("myText").value="190.6";
    document.getElementById("myText1").value="45.99";
    document.getElementById("myText2").value="0.012";
 }
</script>

<div id="cs-tc" class="col-sm-4 text-center">
  <label id="cs-tc-label" class="control-label">Critical Temperature (K)</label>
 <input type="text" id="myText" value=" " class="form-control" name="cs_tc">
</div>

<div id="cs-pc" class="col-sm-4 text-center">
  <label id="cs-pc-label" class="control-label">Critical Pressure (atm)</label>
  <input type="text" id="myText1" value=" " class="form-control" name="cs_pc">
</div>

<div id="cs-acc" class="col-sm-4 text-center">
  <label id="cs-acc-label" class="control-label">Accentric Factor</label>
  <input type="text" id="myText2" value=" " class="form-control" name="cs_acc">
</div>

<script>
$(document).ready(function() {
  $.ajax({
    type: "GET",
    url: "B1_1.csv", //read csv file
    dataType: "text",
    success: function(data) {processData(data);}
   });
});

function processData(allText) {
 var allTextLines = allText.split("/\r\n|\n/");
 var headers = allTextLines[0].split(',');
 var lines = [];

 for (var i=1; i<allTextLines.length; i++) {
  var data = allTextLines[i].split(',');
  if (data.length == headers.length) {

   var tarr = [];
   for (var j=0; j<headers.length; j++) {
    tarr.push(headers[j]+":"+data[j]);
   }
   lines.push(tarr);
  }
 }
}
</script>

read more

How to get local data source in server side applications?

I am using blazor server side application. In that I need to refer local dataSource.

I have used the Http as like default client side sample.

@code{

    ChartData[] dataSource;
    protected override async Task OnInitAsync()
    {
        dataSource = await Http.GetJsonAsync<ChartData[]>("scripts/aapl.json");
    }
}

But I have been facing the issue like below,
enter image description here

Can anyone guide me to fix this?

How to get local data source in server side applications?

Lookup a dictionary of dictionaries in Python

I am trying to lookup a dictionary of dictionaries and facing difficulty to do so.

The dictionary looks like this:

CME {u'JPY': 0.525, u'USD': 3.305, u'CNH': 4.805}
EUREX   {u'USD': 3.305, u'GBP': 1.545, u'EUR': 0.375}
GOODM   {u'KRW': 0.0}
HKEX    {u'USD': 3.395, u'HKD': 3.565, u'CNH': 4.895}
KIS {u'KRW': 0.0}
NLFX    {u'USD': 3.305}
OSE {u'JPY': 0.615}
SGX {u'JPY': 0.725, u'USD': 2.605, u'SGD': 2.575, u'CNH': 5.005, u'CNY': 0.0}
TOCN    {u'JPY': 0.525}

When i do this: data['GOODM']['KRW'], i get 0. However, when i do this: data[margins['opp_pty_cd']][margins['cur']], i get this:

read more