angular7

Angular 7 Mapping object with array of object to mat table

百般思念 提交于 2019-12-12 18:28:00
问题 I am trying to map one of my object to mat-table . Input object from Web API is as follows : [ { "inventoryId": 1004, "inventoryName": "Red Shirt Material", "dateReport": [ { "date": "2019-03-04T19:15:16.828", "quantity": 109.9 }, { "date": "2019-03-09T10:36:12.198", "quantity": 26.6 } ] }, { "inventoryId": 1003, "inventoryName": "Blue Pant Material", "dateReport": [ { "date": "2019-03-04T19:15:16.828", "quantity": 64.4 }, { "date": "2019-03-09T10:36:12.198", "quantity": 8 } ] } ] HTML code

Firestore where 'array-contains' query doesn't work with references

女生的网名这么多〃 提交于 2019-12-12 12:09:12
问题 I have a collection 'chats' with a members array which contains users participating in the chat. The problem is I want to get all chats where the current user is participating. I do this with this query: getUserChats(): Observable<Chat[]> { return this.auth.currUser .pipe( take(1), switchMap(user => this.afs .collection('chats', ref => ref.where('members', 'array-contains', `/users/${user.uid}`)) .snapshotChanges() .pipe( map(actions => { return actions.map(action => { const data = action

Firebase Functions Log Error: function execution attempt timed out. Function invocation was interrupted

ぃ、小莉子 提交于 2019-12-12 10:20:48
问题 Issue: Error: function execution attempt timed out. Function invocation was interrupted. Exact Log Error: Error: function execution attempt timed out. Function invocation was interrupted. Tech: Angular 7, Angular Universal (SSR), Firebase, Firebase Functions. My functions/index.js file const functions = require('firebase-functions'); const { app } = require('./dist/server'); exports.ssr = functions.https.onRequest(app); Screen shot of the Firebase Functions Log Error: My functions package

migrating from Angular 6 to Angular 7

对着背影说爱祢 提交于 2019-12-12 10:14:30
问题 I have recently upgraded my Angular 4 app to Angular 6 and now want to upgrade to Angular 7. According to the below article , running command the following command shouldn't take more than 10 mins to upgrade. ng update @angular/cli @angular/core https://blog.angular.io/version-7-of-angular-cli-prompts-virtual-scroll-drag-and-drop-and-more-c594e22e7b8c I dont see anything happening on the command prompt after running this command. No errors. Could somebody tell me why this is happening 回答1: I

angular7 input type file upload not working

孤人 提交于 2019-12-12 09:54:17
问题 Present i'm working angular angular 7 input type="file" not working. Angular6 its working fine. angular 6 submit the input file type data i will get field list like this But angular 7 only get image path like this. only i updated angular 6 to angular 7 i will get this error. what is the issue i don't know. Thanks , 回答1: I have a upload document section in my Angular7 app, here is working example: example.component.html <form [formGroup]="form"> <div class="form-group"> <label>Select file to

On updating the interpolated values of the element affects the custom directive applied on it

别说谁变了你拦得住时间么 提交于 2019-12-11 17:14:32
问题 What is the correct way to update the values of a particular index. I have custom drag and drop and a "area" within within which the elements can be dragged and dropped and moved inside that "area" =>the div having class dropzone. I also want to interpolate the current x and y positions of the element being moved within the the "area". I calculate the positions and I want to update the interpolated values to the latest one in the below code. But when I update the values using the if/else if

How to upload documents to CouchDB from Angular using HttpClient

社会主义新天地 提交于 2019-12-11 16:55:08
问题 I set up a new CouchDB on my local computer. When I try to upload new documents to an existing database using HTTP POST method, CouchDB refuses the request and claims it was HTTP OPTIONS method. Typescript classes My service class looks as follows. import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; @Injectable() export class DbService { private static readonly BASE_URL = 'http://localhost:5984/'; private static readonly ENTRIES_URL = DbService.BASE

Toggle and Modals are not working on Angular app

陌路散爱 提交于 2019-12-11 16:15:01
问题 I am new to Angular and having some issues with getting Bootstrap toggle and Modal to work. BootStrap CSS files are working because the form is picking up the styling; however, I reckon JS files are not being linked properly. Please let me know what am I doing working. I did an NPM install of BootStrap and jQuery using the Angular CLI. Once installed, I linked the BootStrap and jQuery files to the angular.json file for the application to be able to use the libraries. "build": { "builder": "

Not loading image from local path in Angular 7

邮差的信 提交于 2019-12-11 15:53:13
问题 It's not loading any image from local path, but loading images from internet. Please help me load images from local. I have created the folder containing images inside the project itself. test.component.ts import { Component, OnInit } from '@angular/core'; @Component({ selector: 'test-app', templateUrl: './test.component.html' }) export class TestComponent implements OnInit { image1= '/img1.png'; image2= 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQCNTJ-wSPyf8KvKYO

angular, map: map give result to subscribe late

孤者浪人 提交于 2019-12-11 15:52:30
问题 I want to build a user page with Angular . In my service I am getting data by this code. getUser(id: number): Observable<User> { return this.http.get(`${this.baseUrl}/getUser.php?id=${id}`).pipe( map((res) => { this.user = res['data']; return this.user; }), catchError(UsersService.handleError)); } In component I am saving data into variable user. This is code. user: User; constructor( private UsersSer: UsersService, private ActiveRout: ActivatedRoute) { } ngOnInit() { this.getUser(); }