angular7

Input box attribute set dynamically on radio button change

ⅰ亾dé卋堺 提交于 2019-12-06 15:16:12
问题 I am having 20 mat-expansion-panel and each expansion-panel having one radio group and each radio group having 5 radio buttons, and below radio button there is one comment box. So I want something like when i select third radio button then specific this expansion-panel comment box will optional otherwise it's required. Currently, change happening in all mat-expansion-panel so want do changes on a specific panel that i have select radio button. So can you please provide me an example something

How can I migrate a web app with Angular v7 to mobile NativeScript app

北城余情 提交于 2019-12-06 14:53:33
I made a simple web app with Angular v7 and I want to migrate it to a NativeScript mobile app . I followed the instructions in https://docs.nativescript.org/angular/code-sharing/migrating-a-web-project#migrating-components but I am facing a difficulty. The app is running in my Android mobile phone but it does not show the content because I need to adjust it properly for a mobile app. It shows auto-generated works. The problem is I do not know how I can do adjust properly the code since I cannot find a properly doc. Any help? My code in app.component.html : <!--The content below is only a

app with combined frontend and backend not deploying to Heroku

流过昼夜 提交于 2019-12-06 14:12:09
问题 I have a angular frontend and nodejs backend app. The issue I am having is when I deploy to Heroku, the build and compile succeeds but I think only the backend is being run on heroku when I click open app. I looked at multiple tutorials and resources on how to deploy an angular and nodejs app on heroku and followed all the instructions but am unable to successfully get the full web app(both angular frontend and nodejs backend to Heroku. the output I get when navigating to the app from the

Run Angular 7 project locally on file:/// without server

喜你入骨 提交于 2019-12-06 13:46:06
问题 I want to build my angular project and generate a ZIP file containing it to send it via email and I want the person who receives it to be able to open it on his Desktop clicking index.html file. I changed the baseUrl to ./ or to document.location but I'm getting the following error: "Unhandled Navigation Error" Does anyone have any hint about how to fix this? 回答1: You can run angular app on double click on index.html file. Just add below code in your app.module.ts note that : remove baseUrl =

migrating from Angular 6 to Angular 7

China☆狼群 提交于 2019-12-06 11:21:15
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 I've updated 6 to 7 using: Angular dependencies npm install @angular/animations@latest @angular/common@latest

Distance Calculation in Angular

佐手、 提交于 2019-12-06 10:38:20
I am making a distance calculation application using angular which has, Html: <form [formGroup]="form" *ngIf="showForm"> <div formArrayName="distance" > <table> <thead> <th> From Distance (Km) </th> <th> To Distance (Km) </th> <th> Fare Per Kilometer </th> </thead> <tbody> <tr *ngFor="let item of form.get('distance').controls; let i = index" [formGroupName]="i"> <td> <input type="number" placeholder="From" formControlName="from"> </td> <td> <input type="number" placeholder="To" formControlName="to"> </td> <td> <input type="number" placeholder="Fare Per Km" formControlName="farePerKm"> </td> <

Angular service that returns observables/subjects from a cache array to multiple instances of a component in realtime

岁酱吖の 提交于 2019-12-06 05:05:48
USE CASE I have a content page that has multiple instances of UserActionsComponent. I also have a global DataService that acts as a data provider with (wannabe) advanced caching. Data fetch hierarchy: In-Memory Cache >> Browser Storage (async) >> HTTP Request UserActionsComponent Requests dataService.getData(URL,params,method) PS: params has details like blogId which makes the hash signature unique DataService (.getData()) 1) Makes a unique hash KEY using something like genUniqueHash(URL+stringify(params)+method) 2) Checks if value is present in an in-memory cache (array[KEY]) - If yes, return

How to use Angular 7 cdkDropList between components?

给你一囗甜甜゛ 提交于 2019-12-06 04:30:44
问题 I have a list of items (students) in a mat-list component on the left side of my screen (general list). I also have a list of class-room Components on the right side of my screen. In each class-room Component, there is a mat-list of students. I want to be able to drag students from to the general List to one of the students lists contained inside any of the class-room Component using the new Drag&Drop API of angular material the pseudo code looks like this: <mat-list #studentsList=

How to fix “ Property 'wheelDelta' does not exist on type 'WheelEvent' ” while upgrading to angular 7,rxjs6?

孤者浪人 提交于 2019-12-05 23:59:50
I'm upgrading to angular7 with rxjs6: in mouseWheelEvent type I am getting "Property 'wheelDelta' does not exist on type 'WheelEvent'" . Do we have any alternative for wheelDelta ? mouseWheelFunc(event: MouseWheelEvent): void { // var event = window.event || event; // old IE support let delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail))); if ( delta > 0) { this.mouseWheelUp.emit(event); } else if ( delta < 0) { this.mouseWheelDown.emit(event); } // for IE event.returnValue = false; // for Chrome and Firefox if ( event.preventDefault) { event.preventDefault(); } } ERROR in

cdk virtualscroll with mat-grid-list

假装没事ソ 提交于 2019-12-05 20:12:10
Is there an virtual scroll implementation that works with the grid-list? I think the default implementation won't work because each row should have an element around it. I'm using the grid-list to display profile pictures, and need an infinite scroll or preferably virtual scroll to load new ones. So since cdk virtualscroll doesn't support multi column, I ended up using ngx-virtual-scroller , which does support multi-columns. The mat-grid-list I also had to let go because of this, but, creating your own tiles isn't that much work when using flexbox. Here's a snippet using multi columns, [users