我是Ionic的新手,并且松散地跟随this tutorial向我的项目添加了firebase身份验证。我遇到了创建用户界面的问题。
在最初的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";
如果我保存了任何项目文件,并强制重建应用程序,则错误消失。它只发生在初始发布时。
我尝试将路径更改为../shared/models/user
无效。
我的user.ts
文件位于src/shared/models/user.ts
。
我在login.ts中的import语句:import { User } from "../../models/user";
用户类:
export interface User {
email: string;
password: string;
}
造成这种情况的原因是什么?
答案 0 :(得分:0)
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
关于../../shared/models/user
?
D:/Ionic/pigsnbulls/pigsnbulls/src/pages/login/
+ ../../shared/models/user
= D:/Ionic/pigsnbulls/pigsnbulls/src/shared/modesl/user