gpt4 book ai didi

angular - 错误 RangeError : Maximum call stack size exceeded, core.js:15724

转载 作者:行者123 更新时间:2023-12-03 23:13:00 31 4
gpt4 key购买 nike

我是 ionic 和 Angular 框架的新手。我开始了一个项目,引用 Auth login

在完成所有步骤后,我遇到了错误,因为这是我无法解决的新框架。

代码

登录页面.ts

    import { AuthenticationService } from './../../services/authentication.service';
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-login',
templateUrl: './login.page.html',
styleUrls: ['./login.page.scss'],
})
export class LoginPage implements OnInit {

constructor(private authService: AuthenticationService) { }

ngOnInit() {
}

login() {
this.authService.login();
}

}

和 login.page.html
<ion-header>
<ion-toolbar>
<ion-title>Login</ion-title>
</ion-toolbar>
</ion-header>

<ion-content padding>
<ion-button (click)="login()" expand="block">Login</ion-button>
<ion-button expand="block" color="secondary" routerLink="/register" routerDirection="forward">Register</ion-button>
</ion-content>

加载页面时出现此错误:
core.js:15724 ERROR RangeError: Maximum call stack size exceeded
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:60)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next (map.js:38)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext (mergeMap.js:84)
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next (InnerSubscriber.js:15)
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at CatchSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77)
at CatchSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext (mergeMap.js:84)
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next (InnerSubscriber.js:15)

PS:我有2个文件,
1:login.page.html,

2:login.module.ts

最佳答案

看起来您正在循环调用一个函数,或者您可能会错过登录模块中的导入路由器模块,请再次检查。

关于angular - 错误 RangeError : Maximum call stack size exceeded, core.js:15724,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55591694/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com