angular6

Angular migration (from 4 to 6) e2e --proxy-config not working

大兔子大兔子 提交于 2019-12-10 12:37:56
问题 I've been currently migrating my app from 4 to 6 and I can not executing my proxy script for my e2e tests . The script listing looks as follows: "scripts": { "ng": "ng", "start": "ng serve", "start:tst1": "ng serve --proxy-config config/proxy/proxy.tst1.json", "start:tst5": "ng serve --proxy-config config/proxy/proxy.tst5.json", ... "test:watch": "ng test", "lint": "ng lint --type-check true", "e2e": "ng e2e", "e2e:tst1": "ng e2e --proxy-config config/proxy/proxy.tst1.json", "e2e:tst5": "ng

Angular 6: Can't bind to 'formGroup' since it isn't a known property of 'form'?

本小妞迷上赌 提交于 2019-12-10 12:34:58
问题 I have worked with form builder in angular 2/4, But now I am using it in angular 6. I have seen this question (Can't bind to 'formGroup' since it isn't a known property of 'form') but it was for angular 2. I doing exact same against angular 4 but I am getting this error. Please help: my code are: app.module.ts: ( I have exported FormsModule & ReactiveFormsModule) : import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { LocalStorage } from

Keyvalue pipe using to print nested values

坚强是说给别人听的谎言 提交于 2019-12-10 12:18:35
问题 Here my stackblitz https://stackblitz.com/edit/angular-vj4llg To print nested array values, I am using Keyvalue pipe <p>Use keyvalue pipe</p> <ul *ngFor="let stdObj of student"> <li>ID : {{stdObj.id}} Name : {{stdObj.name}} <ng-container *ngFor="let test of stdObj?.value | keyvalue"> {{test.key}} : {{test.value}} </ng-container> </li> </ul> In typescript this.student = [ { id:123, name: "Test", value:["{pass: true,verified: true}"] }, { id:435, name:"Test12", value:["{pass: false, verified:

angular2firebase - multiple instances using Angular 6

☆樱花仙子☆ 提交于 2019-12-10 12:17:27
问题 I'm upgrading to Angular 6 using AngularFire2 . My app referenced 2 Firebase projects using code like this to create the database reference: public initFirebaseApp(config: FirebaseAppConfig, firebaseAppName: string) { this._db = new AngularFireDatabase(_firebaseAppFactory(config, firebaseAppName)); } This code is now broken. I get this: ERROR in src/app/services/firebase.service.ts(24,25): error TS2554: Expected 5 arguments, but got 1. Thanks! 回答1: AngularFire now support many more

Offset selectionChange Angular

回眸只為那壹抹淺笑 提交于 2019-12-10 11:36:33
问题 I have a form which contains 1 drop-down list and 2 inputs. I have a drop down list which contains several objects. When I select one of them, I can retrieve the whole object and I am supposed to filled the two other inputs with the value from the selected object. However, it seems there is an offset when I do that. For instance I have an object banana in my list. If i select it nothing will happen. The 2 other inputs will not be filled at first. Then if I select another object such as apple,

Angular 6 Follow up: [attr.disabled] in option value disables all entries

独自空忆成欢 提交于 2019-12-10 10:42:35
问题 Topic: Angular 6, Reactive Form, DropDown Menu, Disable One Option: all instead of just the one intended value are disabled, even though the inspector says disabled=false. People were very kind to help me with my problem earlier: "Angular 6 Reactive Form - Select options: disable previously selected options" but they seemed to disappear after I hit a roadblock, hence my new question: Why are ALL option values disabled instead of just the one that is supposed to match the statement? [attr

How to show tooltip on @ng-select/ng-select options

こ雲淡風輕ζ 提交于 2019-12-10 10:28:57
问题 I am using @ng-select/ng-select@2.3.6 in my application and i have a very long text in array. So, the complete text not visible in dropdown list so I want to show the title/ tooltip over the each and every options I tried, let listArray = [{name: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s'}]; <ng-select placeholder="Select" (change)="onChange($event)"> <ng-option *ngFor="let list of

debounceTime & distinctUntilChanged in angular 6

六月ゝ 毕业季﹏ 提交于 2019-12-10 10:16:06
问题 I found some tutorial in rxjs that uses debounce and distinctUntilChanged. How can I implement it in angular 6? The tutorial code is this: var observable = Rx.Observable.fromEvent(input,'input'); observable.map(event=>event.target.value) .debounceTime(2000) .subscribe({ next:function(value){ console.log(value) } } This is my code: In html, I have this: <input class="form-control" [(ngModel)]="userQuestion" type="text" name="userQuestion" id="userQuestions"> in Typescript, I have this: import

AG-Grid: show certain “action” buttons in grid depending on condition

自闭症网瘾萝莉.ら 提交于 2019-12-10 10:03:41
问题 I'm using the community edition of "AG Grid" in my Angular 6 application. My challenge right now is this: I have a fairly simple data structure, a list of which gets bound to the grid for display. Based on its values, I'd like to add an "Actions" column to the grid, to give the user access to certain actions, e.g. delete an entry, "promote" it etc. For individual data-bound column, I get the corresponding data value of each row as it's being bound, and I can e.g. format the display using a

Google Authentication in Angular 6

别说谁变了你拦得住时间么 提交于 2019-12-10 09:43:08
问题 I have created a project in angular 6 which exhibits google authentication using angular-6-social-login. Following is the install command: npm install --save angular-6-social-login After this, i made the following changes to the app.module.ts file: import {SocialLoginModule,AuthServiceConfig,GoogleLoginProvider} from "angular-6-social-login"; // Configs export function getAuthServiceConfigs() { let config = new AuthServiceConfig( [ { id: GoogleLoginProvider.PROVIDER_ID, provider: new