angular8

ngFor - Can't bind to 'testid' since it isn't a known property of 'input'. how to concat id with string?

淺唱寂寞╮ 提交于 2019-12-13 03:18:00
问题 I am trying to add the index value with my ids. but getting an error as: Can't bind to 'testid' since it isn't a known property of 'input'. here is my template: <td *ngFor="let col of columns; let i = index" [ngClass]="col.class" data-testid="form-create-td-{{i}}"> what is wrong with my code? any one help me? 回答1: I think you will need property binding. So please try to replace below testid data property. <td ... [attr.data-testid]="'form-create-td-' + i"> For concatenation id property with

Trying to add a computed property to a result set from a controller in Angular

血红的双手。 提交于 2019-12-13 03:16:11
问题 I'm using Angular 8 and am trying to do something that seems like it should be really simple. I'm retrieving an array of records from my controller on the server using http.get. Those records have a particular type (defined within Angular) and I would like to add a computed property to that type called "meetsTarget". My problem is that it is not recognising that that property exists on the results I get back from the server. Question 2: Becasue that property is computed from other properties,

Angular Nested categories and *ngFor loop

我的未来我决定 提交于 2019-12-11 19:07:57
问题 I have an undefined number of arrays that can go nested unlimited. I will use this in the "filtering" section on a page where I list products. But I couldn't dynamically figure out how to create it on the html side. [ { "name": "Models", "items": [ { "name": "Fabric", "fieldType": "checkbox", "subCategories": [] }, { "name": "Linen", "fieldType": "checkbox", "subCategories": [ { "name": "Colored", "fieldType": "checkbox", "subCategories": [] }, { "name": "Solid Color", "fieldType": "checkbox"

Angular Material Datepicker with ControlValueAccessor and formControlName [duplicate]

假如想象 提交于 2019-12-11 16:28:39
问题 This question already has an answer here : Custom Component MdDatePicker used in reactive Form (1 answer) Closed 10 days ago . I am trying to utilize ControlValueAccessor with Angular Material datepicker. For some reason, its not not working with formControlName and a reactive form. Can someone resolve this? The wrappers are being built for certain styling and attributes. The values are sent to reactive form, etc https://material.angular.io/components/datepicker/overview Typescript: import {

How to Display Values in Angular 8 Shows ERROR TypeError: Cannot read property 'project_name' of undefined

微笑、不失礼 提交于 2019-12-11 15:25:58
问题 My ts code coding is, this.api.getPay(this.donationId).subscribe( data => { this.paymentData = data; this.paymentDetails = this.paymentData.donationDetails[0]; } ) My html code is like Project : <strong>{{paymentDetails.project_name}}</strong><br/> Status: <strong>{{paymentDetails?.status}}</strong><br/> Now project_name and Status details will be displayed. Console gets "ERROR TypeError: Cannot read property 'project_name' of undefined" If I added "?" like {{paymentDetails?.project_name}} No

How to generate dynamically reactive forms in angular 8

萝らか妹 提交于 2019-12-11 14:24:33
问题 I opened question about dynamically generate form controllers,after that I have some issues with dynamically template generate and controllers generate. in this project,mainly I have 4 types of questions in an array.I have to generate these questions dynamically question types are, MCQ ( only have to select one answer) Multiple Select ( User can select multiple answers and at least one required) Ranking question ( user have to give the correct order of answers. answers should be unque)

Angular: How to navigate to child route from parent component by using navigate method

随声附和 提交于 2019-12-11 07:47:27
问题 Here is my html rouerLink: <a [routerLink]="['create']">Create</a> - works fine. on button click I am calling the same as: But not works.. navigateTo(page) { this.router.navigate(['create']); //not works } Any one help me, what is really I am missing here? UPDATE I am navigating from parent to child here is the routes: { path: 'contentPlaceholder', data: { showNavi: true }, component: ShellContentPlaceholderComponent, children : [ { path: 'view', data: { showNavi: false }, component:

How to deploy angular 8 ssr and django rest framework separately on the same server (heroku or digitalocean) )

泪湿孤枕 提交于 2019-12-11 07:28:31
问题 Most of the tutorials say that you have to integrate angular into django but I do not want to do that. I want to deploy both on the same server with angular using node-express and django using gunicorn. But I do not know how to do it. I know how to deploy angular ssr only and django alone but not both on the same server. Thanks in advance 回答1: I'm going to answer your question on how to do what you ask, but I will also point you in a direction that I believe is more efficient, stable and

Angular PWA Offline Storage

有些话、适合烂在心里 提交于 2019-12-11 03:35:28
问题 I’m building a new web application which needs to work seamlessly even when there is no internet connection. I’ve selected Angular and am building a PWA as it comes with built-in functionality to make the application work offline. So far, I have the service worker working perfectly and driven by the manifest file, this very nicely caches the static content and I’ve set it to cache a bunch of API requests which I want to use whilst the application is offline. In addition to this, I’ve used

Material-UI drop-down menu causing error in IE11 after updating to angular 8

冷暖自知 提交于 2019-12-11 02:32:08
问题 Angular 8 application with material 8 throws following error on IE11 when the material menu is opened: Unable to get property 'opacity' of undefined or null reference It worked well with angular 7.2. Used IE11 Version: 11.1146.16299.0 Update version: 11.0.125 New project dependency versions: "dependencies": { "@angular/animations": "^8.0.0", "@angular/cdk": "^8.0.0", "@angular/common": "~8.0.0", "@angular/compiler": "~8.0.0", "@angular/core": "~8.0.0", "@angular/forms": "~8.0.0", "@angular