vietngogs

1

votes
2

answer
683

views

Angular 5 Unit testing throwing error for “components should create ” test case

I am trying Angular 5 unit testing for the first time. While I already created the app then decided to run testing in it. But I am getting these errors: AppComponent should create the app AppComponent should have as title 'app' AppComponent should render title in a h1 tag GalleryComponent should cr...
vietngogs
1

votes
1

answer
62

views

Promise used for concatanation of array from different arrays

I want to construct an array with the help of 3 other arrays. I am using JS promise for this purpose but not able to get the implementation right. SO what I basically want to do is to populate an array first. let getPlacePromise = function() { return new Promise(function(resolve,reject){ this.getp...
vietngogs
1

votes
0

answer
66

views

Filter search based on array values in angular 4

I am new in angular 4. While trying to make a search bar got stuck in the logic. So I have a JSON file, and I am trying to search relevant key value pair of that JSON file based on an array values. My json file : const trips = { '20180201': [{ 'journeyId': 1001, 'Number': '001', 'DriverName': 'Alex...
vietngogs
1

votes
1

answer
46

views

Filtering an object to check wheter all the elements of an array is present or not

I am new in concept of key-value pair and trying to figure out a way to filter all the key value pairs which has all the elements of an array, but I am struck somewhere inside the looping. my key value pair: Alltrips = { '20180301': [{ 'transporter': { 'company': 'Pradeep Transport', 'id': 1518419...
vietngogs
1

votes
1

answer
163

views

Scattered plot zooming not working correctly in d3.js

I am trying to create a scatterplot with a zooming. The following code I have used in my angular application and its working till a certain extent when I run it in my local server. However putting the same code in Stackblitz, the zooming is not working. I want to achieve a zooming where the zooming...
vietngogs
1

votes
0

answer
573

views

Cross-Origin Request Blocked in mozilla firefox while using fetch()

I am trying to get data from an API and show it in my browser. I am using the fetch() method instead of making an AJAX call. My code is working perfectly in Chrome. However, in Mozilla it's showing this error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resourc...
vietngogs
1

votes
3

answer
39

views

How to loop through a nested key value pair and filter it based on a array values

I have an array which is built from the user input. I am trying to loop through a nested key value pair and check whether the values in it matches any value of the given array. The purpose is to make a search facility. My array : FilteredSelectedOptions=['20180211','Trax','Vienna','AN01020'] My key...
vietngogs