[英]Why Can't Ionic Find My Model Interface?
I am new to Ionic and am loosely following this tutorial to add firebase authentication to my project. 我是Ionic的新手,并且不熟悉本教程 ,将Firebase身份验证添加到我的项目中。 I am having an issue with the user interface that is created.
我在创建的用户界面上遇到问题。
On the initial ionic serve
在最初的
ionic serve
Typescript Error
Cannot find module '../../models/user'.
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/login.ts
import { AngularFireAuth } from 'angularfire2/auth';
import { User } from "../../models/user";
If I save any of the project files, and force the app to rebuild, the error disappears. 如果我保存了任何项目文件,并强制重新构建应用程序,则错误消失。 It only happens on the initial serve.
它仅在初始发球时发生。
I have tried changing the path to ../shared/models/user
to no avail. 我试图将路径更改为
../shared/models/user
无济于事。
My user.ts
file is located at src/shared/models/user.ts
. 我的
user.ts
文件位于src/shared/models/user.ts
My import statement in login.ts: import { User } from "../../models/user";
我在login.ts中的导入语句:
import { User } from "../../models/user";
User class: 用户类别:
export interface User {
email: string;
password: string;
}
What is causing this? 是什么原因造成的?
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/
+ ../../models/user
= D:/Ionic/pigsnbulls/pigsnbulls/src/models/user
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/
+ ../../models/user
= D:/Ionic/pigsnbulls/pigsnbulls/src/models/user
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/
+ ../shared/models/user
= D:/Ionic/pigsnbulls/pigsnbulls/src/pages/shared/models/user
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/
+ ../shared/models/user
= D:/Ionic/pigsnbulls/pigsnbulls/src/pages/shared/models/user
Whats about ../../shared/models/user
? 关于
../../shared/models/user
呢?
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/
+ ../../shared/models/user
= D:/Ionic/pigsnbulls/pigsnbulls/src/shared/modesl/user
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/
+ ../../shared/models/user
= D:/Ionic/pigsnbulls/pigsnbulls/src/shared/modesl/user
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.