在实现期间无法在打字稿中找到OnInit [英] cannot find OnInit in typescript during implementation

查看:35
本文介绍了在实现期间无法在打字稿中找到OnInit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用loginComponent进行示例项目,当我尝试添加OnInit时遇到以下错误,我需要在类中实现OnInit

I am working on a sample project with a loginComponent, I need to implement OnInit in my class when i try to add the OnInit i am getting the following error

[ts]找不到OnInit

[ts] cannot find OnInit

这是我的代码

export class loginComponent implements OnInit{

 ngOnInit():all{

    }
}

如何解决此问题

预先感谢

推荐答案

import { OnInit } from '@angular/core';

这篇关于在实现期间无法在打字稿中找到OnInit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆