angular5

Angular 5 Upgrade NullInjectorError: No provider for InjectionToken LocaleId

纵然是瞬间 提交于 2020-05-14 07:44:08
问题 I have an Angular 4 app that I have upgraded to Angular 5 with CLI 1.5.4. I also have a shared library using npm link. After upgrading I had to add this to my tsconfig.app.json to get the CLI building again: "include": [ "./**/*.ts", "../node_modules/my-lib/src/**/*.ts", "../node_modules/my-lib/index.ts", "../node_modules/my-lib/ng2-icad-cf.ts" ], After a successful build, I am presented with the following error when visiting localhost:4200 NullInjectorError: No provider for InjectionToken

Angular 5: Route animations for navigating to the same route, but different parameters

霸气de小男生 提交于 2020-05-12 03:43:12
问题 In my Angular 5 application, the user may navigate to a route which uses the same route, but with different parameters. For example, they may navigate from /page/1 to /page/2 . I want this navigation to trigger the routing animation, but it doesn't. How can I cause a router animation to happen between these two routes? (I already understand that unlike most route changes, this navigation does not destroy and create a new PageComponent . It doesn't matter to me whether or not the solution

Angular 5: Route animations for navigating to the same route, but different parameters

和自甴很熟 提交于 2020-05-12 03:42:27
问题 In my Angular 5 application, the user may navigate to a route which uses the same route, but with different parameters. For example, they may navigate from /page/1 to /page/2 . I want this navigation to trigger the routing animation, but it doesn't. How can I cause a router animation to happen between these two routes? (I already understand that unlike most route changes, this navigation does not destroy and create a new PageComponent . It doesn't matter to me whether or not the solution

RangeError: Maximum call stack size exceeded when using valueChanges.subscribe

北城余情 提交于 2020-05-10 07:06:48
问题 I am using Angular 5 with Reactive forms and need to make use of the valueChanges in order to disable required validation dynamically component class: export class UserEditor implements OnInit { public userForm: FormGroup; userName: FormControl; firstName: FormControl; lastName: FormControl; email: FormControl; loginTypeId: FormControl; password: FormControl; confirmPassword: FormControl; ... ngOnInit() { this.createFormControls(); this.createForm(); this.userForm.get('loginTypeId')

Mat-Table : Scroll a row into view in angular 2

谁说胖子不能爱 提交于 2020-04-13 18:11:33
问题 Is it possible to scroll a specific data row into view when using the angular material mat-table cdk-table ? I'm trying to implement keyboard scrolling with no luck. 回答1: I've it working now. Not perfect but it works. See the example on stack blitz mentioned in my earlier message. https://stackblitz.com/edit/mensand-rowselect?file=app%2Ftable-basic-example.html 来源: https://stackoverflow.com/questions/49697459/mat-table-scroll-a-row-into-view-in-angular-2

Mat-Table : Scroll a row into view in angular 2

久未见 提交于 2020-04-13 18:11:31
问题 Is it possible to scroll a specific data row into view when using the angular material mat-table cdk-table ? I'm trying to implement keyboard scrolling with no luck. 回答1: I've it working now. Not perfect but it works. See the example on stack blitz mentioned in my earlier message. https://stackblitz.com/edit/mensand-rowselect?file=app%2Ftable-basic-example.html 来源: https://stackoverflow.com/questions/49697459/mat-table-scroll-a-row-into-view-in-angular-2

How to make a synchronous call in angular 5?

蹲街弑〆低调 提交于 2020-04-10 09:17:27
问题 So, I was trying to get the solution of this problem. But, somehow I am unable to do so, May be because of the lack of knowledge in angular 5. This is my service: GetCurrentUserData(): Observable<ResponseData> { return this.http.get<ResponseData>(ApplicationURLS.GetCurrentUserInformation) .map(response => { return response; }); //.catch(error => this.handleError(error)); } This is my component: public GetCurrentUserInformation(): any { return this.loginService.GetCurrentUserData().subscribe

Handling multiple radio buttons in a Quiz Angular 5

自作多情 提交于 2020-03-24 00:34:25
问题 I'm new to Angular and Implementing a Quiz containing multiple MCQs. But I am having trouble in radio button selection. My Questions are coming from the database and Options too. mcq.component.html <form (ngSubmit)="ff.form.valid && answer(ff)" #ff="ngForm"> <div *ngFor="let question of questions"> <p style="font-size: 25px;">{{question.title}}</p> <div *ngFor="let option of question.options"> <input [(ngModel)]="option_model.selected_option_id" #selected_option_id="ngModel" type="radio"

Angular 5 material: dropdown (select) required validation is not working

我的梦境 提交于 2020-03-21 19:16:33
问题 I have a material dropdown inside my ngForm, when I set this select as required it shows an asterisk * beside it but the form is seen as valid if I don't select any option from the dropdown. <mat-form-field class="col-4 offset-1"> <mat-select placeholder="Some placeholder" [(value)]="data.name" required> <mat-option *ngFor="let name of names" [value]="name.value"> name.viewValue </mat-option> </mat-select> </mat-form-field> This is unlike what happens if I set the material input to required

Angular 5 material: dropdown (select) required validation is not working

你说的曾经没有我的故事 提交于 2020-03-21 19:14:50
问题 I have a material dropdown inside my ngForm, when I set this select as required it shows an asterisk * beside it but the form is seen as valid if I don't select any option from the dropdown. <mat-form-field class="col-4 offset-1"> <mat-select placeholder="Some placeholder" [(value)]="data.name" required> <mat-option *ngFor="let name of names" [value]="name.value"> name.viewValue </mat-option> </mat-select> </mat-form-field> This is unlike what happens if I set the material input to required