angular

How to make a massive delete in angular 4 with an array of ids

匆匆过客 提交于 2021-02-20 04:06:29
问题 I'm trying to make a massive delete, in order to do that I have an Array<number> of the ids I want to delete. I can't pass this array as a parameter to the method this._httpService.delete(uri,options) . The type of _httpService is Http . So I'm looping the array and inside the loop I'm making single calls, but each call is async and I have certain logic to run when the loop ends. 回答1: Actually you can send the id array in the body of a DELETE request, according to this answer, like so: http

How to make a massive delete in angular 4 with an array of ids

倾然丶 夕夏残阳落幕 提交于 2021-02-20 04:05:13
问题 I'm trying to make a massive delete, in order to do that I have an Array<number> of the ids I want to delete. I can't pass this array as a parameter to the method this._httpService.delete(uri,options) . The type of _httpService is Http . So I'm looping the array and inside the loop I'm making single calls, but each call is async and I have certain logic to run when the loop ends. 回答1: Actually you can send the id array in the body of a DELETE request, according to this answer, like so: http

Sending Variable from Component to Service in Angular 5

…衆ロ難τιáo~ 提交于 2021-02-20 03:49:37
问题 In my current Angular 5 project, I have been making successful API calls from my service (Code kept clean for brevity) myService.ts : @Injectable() export class my-service-service { constructor(private _http: HttpClient) { } myData1() { return this._http.get("API_URL") .map(result => result); } And accessing that information on my connected component by subscribing to the above service. myComponent.ts: import { myServiceService } from './my-service-service.service'; @Component({ ... })

Sending Variable from Component to Service in Angular 5

烂漫一生 提交于 2021-02-20 03:47:01
问题 In my current Angular 5 project, I have been making successful API calls from my service (Code kept clean for brevity) myService.ts : @Injectable() export class my-service-service { constructor(private _http: HttpClient) { } myData1() { return this._http.get("API_URL") .map(result => result); } And accessing that information on my connected component by subscribing to the above service. myComponent.ts: import { myServiceService } from './my-service-service.service'; @Component({ ... })

net::ERR_CONNECTION_RESET angular api request causes duplicates?

只愿长相守 提交于 2021-02-20 03:46:43
问题 I have an application with a .NET c# middle tier and angular front end. I am calling an api which results in a long running process. In IE I captured a message saying net::ERR_CONNECTION_RESET. In Chrome, I'm seeing a failed status after 10 minutes. I looked in our log tables and event viewer. The process is running on the server without failure, but something is causing the api controller method to run multiple times, every 5 minutes. In my developer tools there is no network indicator that

Why can not I upload the node_modules file into GitHub repository?

落爺英雄遲暮 提交于 2021-02-20 02:51:48
问题 I have a project I wrote using angular 6. I want to upload into GitHub the project but when i upload the project with GitHub Desktop, all files are uploaded except node_modules file. When i download the project from GitHub and i try to run, because of the node_modules file is not uploaded, the project is not working. So other people can not run the project too. if i can include the node_modules file in the GitHub Repository. it will run. So, Why the node_modules file does not upload into

Is it possible to pass data after initializing the components?

北慕城南 提交于 2021-02-20 02:36:27
问题 I have three components as shown on the image below and use a custom form component in my feature component. However, there is not a direct parent-child relationship between these two components and there is also a form component between them. I pass data from feature to form using @Input propert that has input values inside a config data (let's say "configData") and then pass them to custom component via @Input property (let's say "configData.test" for test input) without any problem (I can

Angular - How to use sum and group by

我怕爱的太早我们不能终老 提交于 2021-02-20 00:24:26
问题 I need to group the records based on ID and display sum of weight. can someone please let me know the sum and group by method in Angular. API Response: data = [ {Id:1, name: 'ABC', weight: 10 }, {Id:1, name: 'ABC', weight: 14 }, {Id:1, name: 'ABC', weight: 16 }, {Id:2, name: 'DEF', weight: 23 }, {Id:2, name: 'DEF', weight: 22 }, {Id:4, name: 'GHI', weight: 44 }, {Id:4, name: 'GHI', weight: 41 } ] Expected output: dataResult = [ {Id:1, name: 'ABC', weight: 40 }, {Id:2, name: 'DEF', weight: 45

Angular - How to use sum and group by

旧街凉风 提交于 2021-02-20 00:20:44
问题 I need to group the records based on ID and display sum of weight. can someone please let me know the sum and group by method in Angular. API Response: data = [ {Id:1, name: 'ABC', weight: 10 }, {Id:1, name: 'ABC', weight: 14 }, {Id:1, name: 'ABC', weight: 16 }, {Id:2, name: 'DEF', weight: 23 }, {Id:2, name: 'DEF', weight: 22 }, {Id:4, name: 'GHI', weight: 44 }, {Id:4, name: 'GHI', weight: 41 } ] Expected output: dataResult = [ {Id:1, name: 'ABC', weight: 40 }, {Id:2, name: 'DEF', weight: 45

Angular - How to use sum and group by

∥☆過路亽.° 提交于 2021-02-20 00:20:13
问题 I need to group the records based on ID and display sum of weight. can someone please let me know the sum and group by method in Angular. API Response: data = [ {Id:1, name: 'ABC', weight: 10 }, {Id:1, name: 'ABC', weight: 14 }, {Id:1, name: 'ABC', weight: 16 }, {Id:2, name: 'DEF', weight: 23 }, {Id:2, name: 'DEF', weight: 22 }, {Id:4, name: 'GHI', weight: 44 }, {Id:4, name: 'GHI', weight: 41 } ] Expected output: dataResult = [ {Id:1, name: 'ABC', weight: 40 }, {Id:2, name: 'DEF', weight: 45