angular7

Angular 8: Not getting selected dropdown values in component using Reactive Form

ぐ巨炮叔叔 提交于 2020-04-30 07:04:26
问题 I am dynamically populating drop downs and it's values. After selecting all the value when I click on the submit button I am not able to set it's value in form, I am getting blank values. HTML: <div class="col-md-6" *ngFor="let type of types"> <div class="form-group"> <label>Select {{ type.cat_name }}</label> <select class="form-control custom-select" (change)="onChangeType($event.target.value)" [value]="type.key_name" > <option value="">-- Select --</option> <ng-container *ngFor="let subType

Angular 8: Not getting selected dropdown values in component using Reactive Form

自闭症网瘾萝莉.ら 提交于 2020-04-30 07:04:01
问题 I am dynamically populating drop downs and it's values. After selecting all the value when I click on the submit button I am not able to set it's value in form, I am getting blank values. HTML: <div class="col-md-6" *ngFor="let type of types"> <div class="form-group"> <label>Select {{ type.cat_name }}</label> <select class="form-control custom-select" (change)="onChangeType($event.target.value)" [value]="type.key_name" > <option value="">-- Select --</option> <ng-container *ngFor="let subType

How to check if an input field is in focus in Angular 7 [duplicate]

隐身守侯 提交于 2020-04-18 07:19:08
问题 This question already has answers here : Detect Input Focus Using Angular 2+ (3 answers) Closed 8 months ago . I have a form and I want to know if any of the input fields in the form are focused or not? I read the ' NgForm ' documentation but didn't find anything related to ' focus '. I found touched but it doesn't satisfy needs. 回答1: You can use the focus and blur events, to track as fields gain or lose focus : <input (focus)="onFocus()" (blur)="onBlur()"> There are also javascript’s own :

Angular material , to select mat-list-option and show the respective data of the selected mat-list-option

戏子无情 提交于 2020-04-16 02:43:04
问题 When the user hovers over the first column of the table , a tooltip comes up which has a button at the bottom. On click of the button, angular mat-dialog opens up which has the first column data on the left hand side of the mat-dialog. I need to achieve 2 things 1) On the left hand side of mat-dialog, mat-list-option should be selected by default depending on whichever row user hovered upon and clicked on its tooltip button. 2) The right hand side of the mat-dialog needs to be populated with

How to generate a HTML FORM from JSON in Angular 7

末鹿安然 提交于 2020-04-14 13:03:54
问题 I want to generate a HTML FORM from below JSON. { "templateName":"C-Learn Survey", "surveyQuestions":[ { "questionTitle":"Enter your name", "questionType":"Text", "questionGroup":{ } }, { "questionTitle":"Enter your empid:", "questionType":"Text", "questionGroup":{ } }, { "questionTitle":"Select your technologies", "questionType":"Multi choice", "questionGroup":{ "options":[ { "optionText":"Java" }, { "optionText":"Mule" }, { "optionText":".net" } ], "showRemarksBox":false } }, {

How to generate a HTML FORM from JSON in Angular 7

守給你的承諾、 提交于 2020-04-14 13:03:26
问题 I want to generate a HTML FORM from below JSON. { "templateName":"C-Learn Survey", "surveyQuestions":[ { "questionTitle":"Enter your name", "questionType":"Text", "questionGroup":{ } }, { "questionTitle":"Enter your empid:", "questionType":"Text", "questionGroup":{ } }, { "questionTitle":"Select your technologies", "questionType":"Multi choice", "questionGroup":{ "options":[ { "optionText":"Java" }, { "optionText":"Mule" }, { "optionText":".net" } ], "showRemarksBox":false } }, {

Ionic 4 net::ERR_CONNECTION_REFUSED(http://localhost/)

喜欢而已 提交于 2020-04-14 07:03:38
问题 I'm facing a problem that when I try to create mobile Front-End application based on Ionic 4 but a net:ERR_CONNECTION_REFUSED(http://localhost/) show up when I run it with cordova on android studio emulator. This what i m using Angular CLI: 7.1.4 Node: 8.9.4 OS: win32 x64 Ionic version 4.5.0 My config.xml 回答1: For anyone else losing their mind that might be using Capacitor go into your capacitor.config.json file and remove this: "server": { "url": "http://localhost:8100" } I've had this in my

Styling mat-radio-button in Angular Material

痴心易碎 提交于 2020-04-13 06:06:08
问题 I have just started using the Angular Material theme within my Angular app. I make use of some radio buttons but want to style them so that they are smaller than usual. I can style the text labels but I am struggling to style the actual buttons themselves (the circles). So for now, I have <mat-radio-group class="smallRadio"> <mat-radio-button value="1">Option 1</mat-radio-button> <mat-radio-button value="2">Option 2</mat-radio-button> </mat-radio-group> How should I go about that? 回答1: Try

Use font awesome 5 on angular material 7

和自甴很熟 提交于 2020-04-08 01:53:03
问题 I'm using angular 7.0.1 and angular material 7.0.2, I want to add the font awesome 5.4.2 icons and I'm trying to follow the steps on fontawesome web but I can't get the font awesome icon font. first: npm install --save-dev @fortawesome/fontawesome-free then in styles.scss add: @import '~@fortawesome/fontawesome-free/scss/fontawesome.scss'; and in _variables.scss add: $fa-font-path: '~@fortawesome/fontawesome-free/webfonts'; now in app.component.ts add: import { MatIconRegistry } from "

Use font awesome 5 on angular material 7

纵饮孤独 提交于 2020-04-08 01:51:47
问题 I'm using angular 7.0.1 and angular material 7.0.2, I want to add the font awesome 5.4.2 icons and I'm trying to follow the steps on fontawesome web but I can't get the font awesome icon font. first: npm install --save-dev @fortawesome/fontawesome-free then in styles.scss add: @import '~@fortawesome/fontawesome-free/scss/fontawesome.scss'; and in _variables.scss add: $fa-font-path: '~@fortawesome/fontawesome-free/webfonts'; now in app.component.ts add: import { MatIconRegistry } from "