angular7

Formarray doesnt show all the records received from service/api

送分小仙女□ 提交于 2019-12-25 03:16:22
问题 I am trying to patch the object received from webapi to an angular reactive form. The form also has a formarray. But, despite having more than 3 or more records only 2 records are being patched to the formarray of the reactive form. I have two entities noseries and noseriesList, where a noseries has zero or many noseriesLists. So after obtaining noseries from webapi, i want to patch properties and navigation list "noseriesLists" of noseries into reactive form. Rest of the properties are being

All requests are not found (404) when the application runs on an external server

孤街浪徒 提交于 2019-12-25 03:08:55
问题 My application works fine when served with the ng serve command or with the ng serve --prod command, but when I build it for production with the ng build --prod command and then serve it with the http-server -p 8080 -c-1 dist/ng-zero command or with the live-server --entry-file=dist/index.html command, any request has a 404 response. I had a look at different questions and their answers here, but nothing helped. I tried the HashLocationStrategy suggestion, I tried the useHash: true one too,

Angular2 radio button validation

三世轮回 提交于 2019-12-25 02:47:24
问题 How to validate radio button and checkbox and zip code in angular 2 i tried but not working.Anyone can find the solutions.please help me to resolve this issue. Demo:https://stackblitz.com/edit/angular-7-template-driven-form-validation-ndspdl?file=app/app.component.html <div class="form-group"> Radio Buttons: <div *ngFor="let enum of enum_details"> <label for="enum_answer_{{enum.name}}"> <input id="enum_answer_{{enum.name}}" [value]='enum.name' type="radio" name="enums" enums="ngModel" [

PrimeNG Toast not displaying after first API call

♀尐吖头ヾ 提交于 2019-12-25 02:23:09
问题 Steps: 1. Click save button 2. Data is saved and returns true 3. runs the code this.messageService.add({severity: "success", summary: "Success Message", detail: "Order submitted"}); expected result -> toast message shows actual result -> toast does not show UNTIL i click on the page (anywhere on the page). Below is what I have tried : this.test.getdata(this.id).subscribe(res=> { if(res.id == 0) { this.zone.run(() => { this.messageService.add({ key: 'custom', severity: 'info', summary:

How to Make SignalR connection establishment When Login in Asp.net core 2.1 & Angular 6

拟墨画扇 提交于 2019-12-25 01:05:14
问题 I want to make SignalR connection establishment when login to system,now it's doing separately.In .net core I used Microsoft.AspNetCore.SignalR package and in angular I used @aspnet/signalr .When user connect with signalR,then that user want to store in a list with connectionId and username. Here is my login method in client side login(model: any) { return this.http.post(this.baseUrl + 'login', model).pipe( map((response: any) => { const user = response; if (user) { localStorage.setItem(

How to select the dropped data UI based on the value present in the dropped item

白昼怎懂夜的黑 提交于 2019-12-25 00:33:54
问题 Hi I am using angular 7 drag and drop feature. I am following this link https://stackblitz.com/edit/angular-material-drag-copy?file=app%2Fapp.component.html I want to check the data which is being dropped and based on the value i need to set whether it is a mat expansion panel or mat list. which is to be shown in the ui. I am using ngrepeat for generating the list items in both the drag and dropped place. Basically I want to decide the UI element which is to used based on the value that is

Problem with Observable after update app to Angular 7 and RxJS 6.3.3

廉价感情. 提交于 2019-12-24 14:13:24
问题 I updated my app to Angular 7 and RxJS 6.3.3 and I've got a problems during making changes into my code. I really need help with that, because I can't to find solution into google or stack overflow. My imports: import { Observable, of } from 'rxjs'; import { map, catchError } from 'rxjs/operators'; import { Injectable, Inject, Optional, InjectionToken } from '@angular/core'; import { Headers, ResponseContentType, Response } from '@angular/http'; import { HttpClient } from '@angular/common

$location.search() equivalent in Angular 7

删除回忆录丶 提交于 2019-12-24 12:20:10
问题 I am migrating Angular JS to Angular 7. I am looking at this code and trying to implement in Angular 7. In the service, $location was injected, and the following methods reset and set the query parameters. function resetAllOptions() { // Clears query params $location.search(''); } function setQueryParameters() { // Sets query parameters $location.search({ searchType: searchType, searchField: searchField, searchValue: searchValue, searchValueTwo: searchValueTwo, searchValueThree:

Angular 7 Form Validation and Display error message

旧街凉风 提交于 2019-12-24 11:16:08
问题 Please look my simple form in Stackblitz https://stackblitz.com/edit/angular-et9uww My form contains 2 checkboxes if I select one of the checkboxes it will populate one textbox. In my scenario, I have 2 checkboxes and 2 text boxes and one submit button. NOTE- in my case i have n number of checkbox and child questions Validation includes -> 2 textbox are mandatory If the user submits the form without entering textbox it will show the error message. STEP to Recreate check the checkbox1, textbox

Is it possible to one method into another file in nodejs and express?

折月煮酒 提交于 2019-12-24 10:51:00
问题 how can I use one method into entire project is it possible? If it's possible please help me with detail. Thanks Advance 回答1: As an example its your log.js file.You can use module.exports to export a function like this module.exports.log = function (msg) { console.log(msg); }; Now if you want to import it in ,suppose app.js file.Just do something like this. var msg = require('./Log.js');// the path is important here msg.log('Hello World'); In above example you are exporting log function