angular7

Very unintuitive “Unexpected closing tag” error on a valid template

送分小仙女□ 提交于 2021-02-09 00:47:32
问题 It's my first day of learning angular and I've encountered a very unintuitive error message, which says: Uncaught Error: Template parse errors: Unexpected closing tag "p". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (" Number {{ i + 1 }}: {{ phoneNumber }} [ERROR ->] "): ng:///AppModule/AddressCardComponent.html@5:0 The error is thrown on a valid html template that

Very unintuitive “Unexpected closing tag” error on a valid template

筅森魡賤 提交于 2021-02-09 00:47:11
问题 It's my first day of learning angular and I've encountered a very unintuitive error message, which says: Uncaught Error: Template parse errors: Unexpected closing tag "p". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (" Number {{ i + 1 }}: {{ phoneNumber }} [ERROR ->] "): ng:///AppModule/AddressCardComponent.html@5:0 The error is thrown on a valid html template that

Very unintuitive “Unexpected closing tag” error on a valid template

ぐ巨炮叔叔 提交于 2021-02-09 00:47:04
问题 It's my first day of learning angular and I've encountered a very unintuitive error message, which says: Uncaught Error: Template parse errors: Unexpected closing tag "p". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (" Number {{ i + 1 }}: {{ phoneNumber }} [ERROR ->] "): ng:///AppModule/AddressCardComponent.html@5:0 The error is thrown on a valid html template that

Angular 7 error RangeError: Maximum call stack size exceeded

假如想象 提交于 2021-02-08 12:16:24
问题 am trying to learn angular by following the official tutorial (https://angular.io/tutorial/) but when following steps for hero component and hero detail component, it raises an error "RangeError: Maximum call stack size exceeded" . the hero.component.html and detail code is as under: <ul class="heroes"> <li *ngFor="let hero of heroes" (click)="onSelect(hero)" [class.selected]="hero === selectedHero"> <span class="badge">{{hero.id}}</span> {{hero.name}} </li> </ul> <!-- <app-hero-detail [hero]

How to Sum nodes in firebase firestore?

血红的双手。 提交于 2021-02-08 10:44:18
问题 I am making app for ordering pizza. Like you see on image i want to take all key values named "ukupno" from each document and Sum it for final price. This is how i fetch cart data: this.cartService.getCart(this.user.Uid).subscribe(res => { this.cart = res.map(i => { return { ...i.payload.doc.data(), id: i.payload.doc.id }; }); }); } getCart(uid) { return this.firestore .collection("cart/") .doc(uid) .collection("/ubaceno") .snapshotChanges(); } 回答1: There are basically two ways to sum up the

429 Too Many Requests - Angular 7 - on multiple file upload

风格不统一 提交于 2021-02-08 07:27:05
问题 I have this problem when I try to upload more than a few hundred of files at the same time. The API interface is for one file only so I have to call the service sending each file. Right now I have this: onFilePaymentSelect(event): void { if (event.target.files.length > 0) { this.paymentFiles = event.target.files[0]; } let i = 0; let save = 0; const numFiles = event.target.files.length; let procesed = 0; if (event.target.files.length > 0) { while (event.target.files[i]) { const formData = new

429 Too Many Requests - Angular 7 - on multiple file upload

纵然是瞬间 提交于 2021-02-08 07:26:20
问题 I have this problem when I try to upload more than a few hundred of files at the same time. The API interface is for one file only so I have to call the service sending each file. Right now I have this: onFilePaymentSelect(event): void { if (event.target.files.length > 0) { this.paymentFiles = event.target.files[0]; } let i = 0; let save = 0; const numFiles = event.target.files.length; let procesed = 0; if (event.target.files.length > 0) { while (event.target.files[i]) { const formData = new

Angular 7 how to specify folder for images in dist

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 14:52:45
问题 When I build project by ng build command in dist folder I got my js files both with all other resources, but I want to move all images and fonts in separate folder like assets . Can anybody help me? Update: angular.json "assets": [ "src/favicon.ico", "src/assets" ], in scss of component I have: background-image: url('assets/img/no-notifications.svg'); but in result I got in dist folder next file: no-notifications.7e08682a570485d1c108.svg Goal is keep image path same as he has been specified

Angular 7 how to specify folder for images in dist

风格不统一 提交于 2021-02-07 14:50:32
问题 When I build project by ng build command in dist folder I got my js files both with all other resources, but I want to move all images and fonts in separate folder like assets . Can anybody help me? Update: angular.json "assets": [ "src/favicon.ico", "src/assets" ], in scss of component I have: background-image: url('assets/img/no-notifications.svg'); but in result I got in dist folder next file: no-notifications.7e08682a570485d1c108.svg Goal is keep image path same as he has been specified

How to apply pipe to value in RouterLink?

为君一笑 提交于 2021-02-05 11:48:40
问题 I have the following route in Angular 7: <a [routerLink]="['/categories', {{ category.name | slugify }}, category.id]">{{category.name}}</a> The problem is with applying the pipe slugify within the routerlink . How can I apply a pipe to a value inside routerLink ? 回答1: Try removing the curly brackets like this: <a [routerLink]="['/categories', category.name | slugify, category.id]">{{category.name}}</a> You don't need them there because you are using property binding which is already