angular6


Nested form array in angular

元气小坏坏 提交于 2020-01-17 01:19:54
问题 I am making angular application with reactive form, where i have made a nested form array which will get nested on button click. A clean working example https://stackblitz.com/edit/angular-thhczx , it has static inputs and hence on click over Add new template , it will add a another nested part and for Add new property , it will generate another property array.. So you had got the above working example concept right?? I would like to have the same json but not with add button and with

How to edit and update the dynamically added input values [closed]

余生颓废 提交于 2020-01-17 01:16:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . Scenario: Below is my json file called contacts : [ { "name": "Ailis Wyld", "addresses": [ { "addressType": "Business", "city": "Lansing", "postalCode": "48930" }, { "addressType": "Home", "city": "Young America", "postalCode": "55573" } ] }, { "name": "Aksel", "addresses": [ { "addressType": "Business", "city

How to always open PrimeNg's p-calendar on today's date

流过昼夜 提交于 2020-01-16 19:58:06
问题 ''I am using PrimeNg's calendar in my Angular Application. I am using multiple selectionMode and binding the calendar to an array of dates from the database. The calendar starts on the latest date in the range from the database but I want it to always start off with today's date and then the user can navigate backwards and forwards to see the previously selected dates from the database. I set the defaultDate but it doesn't make any difference. Please help. Thanks, my html: <p-calendar [

Make Module global available in Angular application

放肆的年华 提交于 2020-01-16 15:41:33
问题 I have the following Module which components I use on other modules: import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ClickOutsideModule } from "ng-click-outside"; import { PopupComponent} from './popup.component'; @NgModule({ declarations: [ PopupComponent ], imports: [ CommonModule, ClickOutsideModule ], exports: [ PopupComponent ], providers: [] }) export class PopupModule {} And I have my AppModule: import { NgModule } from '@angular/core'

Angular 8, can checkbox value pass onto components? not not in a parent/child relation

若如初见. 提交于 2020-01-16 11:58:21
问题 <input type=checkbox [(ngModel)]="myCheckBox" (ngChanged)="!myCheckBox"> for example, if I want the code above to pass the "checked" value, which is "true or false" to other components, so its contents can react based on "myCheckBox" true | false, and they are not in a parent child relationship, is there any way I can do that? Please help, really apprecipate it!!!! 回答1: You can implement it by different methods. For example: with EventEmitter or rxjs( Subject, BehaviourSubject); In my example

UTC date for mat-date picker in angular 6

 ̄綄美尐妖づ 提交于 2020-01-16 09:14:53
问题 i have used mat-datepicker for my angular 6 project.But in date picker in is showing current timezone date.Instead of this i need to display current UTC date. Here is my code .ts file var nowDate = new Date(); this.startdate = nowDate; this.enddate = nowDate; .html file <mat-form-field style="margin-right: 25px;"> <input matInput [matDatepicker]="picker_start" placeholder="Start Date" [(ngModel)]="startdate" [ngModelOptions]="{timezone: 'UTC'}"> <mat-datepicker-toggle matSuffix [for]="picker

How to plot data on time differences?

久未见 提交于 2020-01-16 08:09:31
问题 I have multiple data on each date for example i have 6 data values those need to plot single date. How would i plot them? I am passing millisecond values in date in ForLoop under generateChartData() function : let newDate = new Date(parseInt(this.vitalHistoryEachData[i]['observation-time'])); //1504549740000,1504535400000,1504532700000,1504530900000 newDate.setDate(newDate.getDate()); // output Mon Sep 04 2017 23:59:00 GMT+0530 (India Standard Time), Mon Sep 04 2017 20:00:00 GMT+0530 (India

How to plot data on time differences?

。_饼干妹妹 提交于 2020-01-16 08:09:09
问题 I have multiple data on each date for example i have 6 data values those need to plot single date. How would i plot them? I am passing millisecond values in date in ForLoop under generateChartData() function : let newDate = new Date(parseInt(this.vitalHistoryEachData[i]['observation-time'])); //1504549740000,1504535400000,1504532700000,1504530900000 newDate.setDate(newDate.getDate()); // output Mon Sep 04 2017 23:59:00 GMT+0530 (India Standard Time), Mon Sep 04 2017 20:00:00 GMT+0530 (India

Angular 6 patchValue Not Setting..sometimes

一世执手 提交于 2020-01-15 12:26:07
问题 I have a basic form shown below. I make a call to an API to grab the user's personal info and I want to fill the form fields with the appropriate values. I have been trying to use patchValue but I cannot get it to work. <form (ngSubmit)="onSubmit" class="example-form" [formGroup]="firstFormGroup" #registerForm="ngForm"> <mat-form-field class="example-full-width"> <input matInput placeholder="Company" formControlName="company" required autofocus> <mat-error *ngIf="firstFormGroup.get('company')

Why my file app.component.html is not working?

廉价感情. 提交于 2020-01-15 11:56:07
问题 My basic angular app is not displaying the app.component.html content, always I have the content of index html. Index HTML: <!DOCTYPE html> <html> <head> <title>Angular 6</title> <base href="/"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="styles.css"> <!-- Polyfill(s) for older browsers --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script>

工具导航Map