|
@@ -1,64 +1,15 @@
|
|
|
|
|
|
# 模块介绍
|
|
|
-- 模块项目:study-ng-contact
|
|
|
-- 模块名称:contact
|
|
|
-- 模块类名:ContactModule
|
|
|
-- 模块内容
|
|
|
- - 页面 2个
|
|
|
- - contact-list 列表页
|
|
|
- - contact-detail 详情页
|
|
|
+- 模块项目:ng-case
|
|
|
+- 模块名称
|
|
|
+ - study 教学案例
|
|
|
+ - aigc AGIC示例
|
|
|
+ - user 用户模块
|
|
|
+ - contact 联系人示例
|
|
|
+
|
|
|
|
|
|
# 安装依赖环境
|
|
|
``` bash
|
|
|
-npm i -S parse
|
|
|
-npm i -S @types/parse
|
|
|
-```
|
|
|
-
|
|
|
-# 复制contact模块
|
|
|
-- 将src/modules/contact整个目录
|
|
|
-- 复制到自己项目src/modules/contact目录处
|
|
|
-
|
|
|
-
|
|
|
-# 根组件加载Parse服务
|
|
|
-- 文件 src\app\app.component.ts
|
|
|
-``` ts
|
|
|
-// 根组件顶部引用并初始化Parse服务
|
|
|
-import * as Parse from "parse";
|
|
|
-Parse.initialize("dev");
|
|
|
-(Parse as any).serverURL = 'http://web2023.fmode.cn:9999/parse'
|
|
|
-```
|
|
|
-
|
|
|
-# 通过app根路由加载:用户模块
|
|
|
-- 文件:src\app\app-routing.module.ts
|
|
|
-- 新增路由内容
|
|
|
-``` ts
|
|
|
-const routes: Routes = [
|
|
|
- // xxx
|
|
|
- {
|
|
|
- path: 'contact',
|
|
|
- loadChildren: () => import('../modules/contact/contact.module').then(m => m.ContactModule)
|
|
|
- }
|
|
|
- // xxx
|
|
|
-]
|
|
|
-
|
|
|
-```
|
|
|
-
|
|
|
-# 通过tabs路由加载:我的页面
|
|
|
-- 文件:src\app\tabs\tabs-routing.module.ts
|
|
|
-- 新增路由内容
|
|
|
-``` ts
|
|
|
-const routes: Routes = [
|
|
|
- {
|
|
|
- path: 'tabs',
|
|
|
- component: TabsPage,
|
|
|
- children: [
|
|
|
- // xxxxxx
|
|
|
- {
|
|
|
- path: 'tab2',
|
|
|
- loadChildren: () => import('../../modules/contact/contact-list/contact-list.module').then(mod => mod.ContactListPageModule)
|
|
|
- }
|
|
|
- // xxxxxx
|
|
|
- ]
|
|
|
-}
|
|
|
-
|
|
|
-```
|
|
|
+npm i # 安装package.json
|
|
|
+ionic serve # 运行项目
|
|
|
+```
|