angular6

A lot of intellisense errors after angular 6 upgrade

穿精又带淫゛_ 提交于 2019-12-24 16:40:36
问题 I have about 80ish errors in my visual studio 2017 error list window after upgrading to angular 6. Those errors only appear in VS as ng serve in command line compiles fine and the application works fine. Severity Code Description Project File Line Suppression State Error TS2339 (TS) Property 'length' does not exist on type '{}'. C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web (tsconfig or jsconfig project) C:\Users\anon\Documents\Projects\EEA.Projects\DEP\MassAir\Web\src\app

In angular how to implement *ngIf with If .. then.. else condition inside a <td> tag?

a 夏天 提交于 2019-12-24 11:35:50
问题 I have tried to show the if else condition inside block of table using ngIf but i am not able to display it. <tr *ngFor="let client of clients"> <!--here i need to implement it--> <td *ngIf="!client.auditorGroup"; then [ngStyle]="titleStyles else [ngStyle]="oldStyles1">{{client.selectionId}}</td> <td>{{client.selectionDate}}</td> <td>{{client.selectedBy}}</td> <td>{{client.panEximNumber}}</td> <td>{{client.name}}</td> <td>{{client.address}}</td> <td>{{client.phoneNumber}}</td> <td>{{client

Create Component without folder

柔情痞子 提交于 2019-12-24 11:24:55
问题 I need to create a component without the folder. I am using Angular-Cli command ng g c testing to create the component. But, the command creates an folder wrapper for the newly created component. 回答1: You can use --flat flag. ng g c test --flat For more information follow this link flat = true | false When true creates the new files at the top level of the current project. Default: false 回答2: You can create components anywhere inside the app folder without using commands if you are using any

Angular 7 Form Validation and Display error message

旧街凉风 提交于 2019-12-24 11:16:08
问题 Please look my simple form in Stackblitz https://stackblitz.com/edit/angular-et9uww My form contains 2 checkboxes if I select one of the checkboxes it will populate one textbox. In my scenario, I have 2 checkboxes and 2 text boxes and one submit button. NOTE- in my case i have n number of checkbox and child questions Validation includes -> 2 textbox are mandatory If the user submits the form without entering textbox it will show the error message. STEP to Recreate check the checkbox1, textbox

How to redirect to angular 6 page when user click on account activation in email

别等时光非礼了梦想. 提交于 2019-12-24 11:06:58
问题 How to redirect to angular 6 page when the user clicks on account activation in the email. My process flow: 1. User register account. 2. The user gets activation account link from the email. Link example: http://localhost/editProfile/{userId} /token/{token}. This should be my API which gets JWT token from backend. 3. User click on the link and user will redirect to edit profile page. My problem is I do not understand by using angular 6 when user redirects to edit profile page how I can get

No directive with “exportAs” set to “ngModel” angular 6

旧巷老猫 提交于 2019-12-24 10:46:07
问题 I'm trying to validate a form with angular 6. Here's my PUG code:- .form-group input.input-lg.form-control(type="text", placeholder="Your firstname", name="fname", #fname="ngModel", required) .alert.alert-danger(*ngIf="fname.invalid") p([hidden]="!fname.errors.required") First name is required` and I get this error: Uncaught Error: Template parse errors: There is no directive with "exportAs" set to "ngModel" (" ]#fname="ngModel" required="required"/> I've already imported the FormsModule in

New line in Angular Notifier

柔情痞子 提交于 2019-12-24 10:29:46
问题 As I cannot find a decision for this, here is a simple question for Angular 6. I am using angular 6 with angular-notofier service and I am trying to show a simple multiline message for the user. I have tried using HTML tags <br/> and New line chars "\n" but with no success. Looks like there is string escaping against XSS or something and I cannot add a new line. Any ideas if I can do it that way OR if I am trying to do it in the wrong way (if so, then why is it wrong and how am I supposed to

How to add unique custom CSS to ngx-smart-modals

有些话、适合烂在心里 提交于 2019-12-24 10:24:01
问题 I am currently building an application in Angular 6. I am using ngx-smart-modal to handle all of my modals. I have 20+ modals in my application. How do I apply CSS to each one uniquely. I have tried using the [customClass] parameter in their documentation, but I am relatively new to Angular/HTML/CSS/etc, and I could not get it working. I can change the sizes of my modals globally using /deep/ .nsm-dialog{ -insert style- } But could not replicate for individual modals HTML <ngx-smart-modal

How to use this pipe with another one in this code for filtering the data in Angular?

旧城冷巷雨未停 提交于 2019-12-24 10:18:13
问题 I've added to form inputs that will filter users by age ranges. Created pipe for that. Now I am trying to implement that in the working example where were used other pipe for filtering results based on other forms. How can I use age range pipe in this working example and make those 2 pipes work together? Here is the code: Age range pipe transform(value: any, args?: any): any { if(!args) return value; return value.filter( item => item.age > args[0] && item => item.age < args[1]) ); } Where

Form validation in angular 6

。_饼干妹妹 提交于 2019-12-24 10:16:14
问题 Below is my component file(login.component.html) <form > <div id="login-container" [class.mat-elevation-z12]="!isActive" [class.mat-elevation-z8]="isActive"> <h2>Login</h2> <mat-form-field class="example-full-width"> <input matInput placeholder="Email address" [formControl]="emailFormControl" required> <mat-error *ngIf="emailFormControl.hasError('required')"> Please enter email id </mat-error> </mat-form-field> <mat-form-field > <input matInput placeholder="Password" minlength="6" maxlength=