GitHub:https://github.com/eshk12/Parabi/
我正在尝试添加一个新的组件调用Medicine (位于Pages dir中)。在导入它之后,我已经将它导入app.modules.ts和app.component.ts。我得到一个空白屏幕与这个错误:
Unhandled Promise rejection: Failed to load HomePage.html ; Zone: <root> ; Task: Promise.then ; Value: Failed to load HomePage.html undefined我希望你们能帮我,THX!
发布于 2016-12-20 17:52:45
在app.component.ts中,需要将该页面添加到数组组件中。
this.pages = [
{ title: 'עמוד הבית', component: HomePage },
{ title: 'WhatEverTitle', component: Medicine },
];还可以导入该页面。看起来您的Medicine.html也需要一些重构。
我建议您使用以下命令生成页面
ionic g page Medicine发布于 2016-12-20 17:55:43
你不需要修复你的app.component,但是就像萨文说的,你需要看看Medicine.html。它不应该有所有常见的doctype,标题,主体,(等等)。标签。出于测试目的,我从Medicine.html中删除了内容,并添加了以下内容
<ion-content>
<p color="dark">Title</p>
</ion-content>使用离子cli生成页面、组件和指令。
https://stackoverflow.com/questions/41248108
复制相似问题