angular8

Modal Layout Responsive in Angular Material

纵饮孤独 提交于 2020-05-24 05:51:26
问题 I have a problem on the responsiveness of using modals in Angular Material. How can i make it look good on small screens. It doesn't have to be mat-grid Pls see this stackblitz link Click Here openDialog() { const dialogRef = this.dialog.open(ModalComponent, { width: "650px", height: "380px" }); } 回答1: DemoYou can use media query in style.css @media only screen and (max-width: 700px) { .modal .mat-grid-tile { width:100% !important; position:relative!important; left:0 !important; } .modal .mat

Modal Layout Responsive in Angular Material

走远了吗. 提交于 2020-05-24 05:50:31
问题 I have a problem on the responsiveness of using modals in Angular Material. How can i make it look good on small screens. It doesn't have to be mat-grid Pls see this stackblitz link Click Here openDialog() { const dialogRef = this.dialog.open(ModalComponent, { width: "650px", height: "380px" }); } 回答1: DemoYou can use media query in style.css @media only screen and (max-width: 700px) { .modal .mat-grid-tile { width:100% !important; position:relative!important; left:0 !important; } .modal .mat

Angular 8: Dynamically set formControlName in html based on component

蹲街弑〆低调 提交于 2020-05-16 07:44:24
问题 In db table, I have "key_name" which is successfully returning in API and working great. What I want to do is to set those fields value as a formControlName in html and in component I am using the reactive form so I have tried formArrayName . Based on the change event I am pushing new formControl in categoryArray and assigning its key as db field's value. here is my Html: <div class="col-md-6"> <div formArrayName="categoryArray" *ngFor="let type of types; let k = index"> <div [formGroupName]=

Angular 8: Dynamically set formControlName in html based on component

时光怂恿深爱的人放手 提交于 2020-05-16 07:42:59
问题 In db table, I have "key_name" which is successfully returning in API and working great. What I want to do is to set those fields value as a formControlName in html and in component I am using the reactive form so I have tried formArrayName . Based on the change event I am pushing new formControl in categoryArray and assigning its key as db field's value. here is my Html: <div class="col-md-6"> <div formArrayName="categoryArray" *ngFor="let type of types; let k = index"> <div [formGroupName]=

Unable to connect to MQTT broker via ngx-mqtt in angular8

╄→гoц情女王★ 提交于 2020-05-15 18:52:45
问题 No matter what i do i can't connect to a mqtt broker via websocket in my angular application (trying in chrome and firefox). For simplicity i'm using HiveMQ broker, i've published on the topic /gat/38/openReservationRequests some data I've followed this medium article on how to connect to mqtt in angular using ngx-mqtt but for me it is not working. In my app: I've installed the module npm install ngx-mqtt --save i've added the configuration and set the module forRoot in my app.module.ts ...

Angular Mat Select CompareWith ID number, and Emit Whole Object

瘦欲@ 提交于 2020-05-14 19:14:18
问题 I have a Mat Select dropdown with the following values from an Object List. export class Product { productId: number; productCode: string; productDescription: string; } The Mat select List is meant to emit the Whole object as follows: <mat-form-field> <mat-select formControlName="productData" [compareWith]="compareProductObjects" <mat-option>Select</mat-option> <mat-option *ngFor="let productItem of ProductList" [value]="productItem"> {{productItem.productDescription}} </mat-option> <mat

Split a combined List based on particular gender data is present for ID

删除回忆录丶 提交于 2020-05-14 07:57:05
问题 Here is a combined list, with unique ageCode. [ { "ageCode": 1, "ageDesc": "0-4", "qM": 358, "sM": 158, "qF": 328, "sF": 258 }, { "ageCode": 3, "ageDesc": "15-59", "qM": 525, "sM": 125 }, { "ageCode": 4, "ageDesc": "60+", "qF": 458, "sF": 358 } ] Combined list need to be split into individual object based on if both M & F value is present for an ageCode. The converted list look like this. If there is No "M" date then there will be no object with "gender": "M" same applied to "F" [ { "ageCode"

Split a combined List based on particular gender data is present for ID

喜你入骨 提交于 2020-05-14 07:56:28
问题 Here is a combined list, with unique ageCode. [ { "ageCode": 1, "ageDesc": "0-4", "qM": 358, "sM": 158, "qF": 328, "sF": 258 }, { "ageCode": 3, "ageDesc": "15-59", "qM": 525, "sM": 125 }, { "ageCode": 4, "ageDesc": "60+", "qF": 458, "sF": 358 } ] Combined list need to be split into individual object based on if both M & F value is present for an ageCode. The converted list look like this. If there is No "M" date then there will be no object with "gender": "M" same applied to "F" [ { "ageCode"

Angular Material DatePicker: Month and Day, Exclude Year

本秂侑毒 提交于 2020-05-09 05:22:30
问题 How do I create a Month and Day Date Picker in Angular, excluding hide year? This following link will do a Month and Year picker. I am trying to manipulate it, to do Month and Day. Replacing YYYY with DD is not working. Stackblitz: https://stackblitz.com/angular/gxymgjpprdy?file=src%2Fapp%2Fdatepicker-views-selection-example.ts Real code from Stackblitz: Typescript: import {Component} from '@angular/core'; import {FormControl} from '@angular/forms'; import {MomentDateAdapter, MAT_MOMENT_DATE

Angular Material DatePicker: Month and Day, Exclude Year

☆樱花仙子☆ 提交于 2020-05-09 05:21:09
问题 How do I create a Month and Day Date Picker in Angular, excluding hide year? This following link will do a Month and Year picker. I am trying to manipulate it, to do Month and Day. Replacing YYYY with DD is not working. Stackblitz: https://stackblitz.com/angular/gxymgjpprdy?file=src%2Fapp%2Fdatepicker-views-selection-example.ts Real code from Stackblitz: Typescript: import {Component} from '@angular/core'; import {FormControl} from '@angular/forms'; import {MomentDateAdapter, MAT_MOMENT_DATE