ryanemax 8 сар өмнө
parent
commit
ddc8b22208

+ 6 - 5
README.md

@@ -1,5 +1,5 @@
 
-### 模块介绍
+# 模块介绍
 - 模块项目:study-ng-user
 - 模块名称:user 
 - 模块类名:UserModule
@@ -8,19 +8,20 @@
         - mine 我的页面
         - login 注册页面
         - edit-info 资料编辑页面
-### 安装依赖环境
+
+# 安装依赖环境
 ``` bash
 npm i -S parse
 npm i -S @types/parse
 ```
 
-### 复制user模块
+# 复制user模块
 - 将src/modules/user整个目录
 - 复制到自己项目src/modules/user目录处
 
 
 
-### 通过app根路由加载:用户模块
+# 通过app根路由加载:用户模块
 - 文件:src\app\app-routing.module.ts
 - 新增路由内容
 ``` ts
@@ -35,7 +36,7 @@ const routes: Routes = [
       
 ```
 
-### 通过tabs路由加载:我的页面
+# 通过tabs路由加载:我的页面
 - 文件:src\app\tabs\tabs-routing.module.ts
 - 新增路由内容
 ``` ts

+ 3 - 1
src/app/tab1/tab1.page.html

@@ -13,5 +13,7 @@
     </ion-toolbar>
   </ion-header>
 
-  
+  <div *ngIf="safeHTML" [innerHTML]="safeHTML"></div>
+  <ion-button expand="block" routerLink="/tabs/tab3">示例:我的页面</ion-button>
+  <ion-button expand="block" (click)="openGit()">代码:study-ng-user</ion-button>
 </ion-content>

+ 4 - 0
src/app/tab1/tab1.page.scss

@@ -0,0 +1,4 @@
+iframe{
+    width:100%;
+    height:100%;
+}

+ 8 - 1
src/app/tab1/tab1.page.ts

@@ -1,4 +1,5 @@
 import { Component } from '@angular/core';
+import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
 
 @Component({
   selector: 'app-tab1',
@@ -7,6 +8,12 @@ import { Component } from '@angular/core';
 })
 export class Tab1Page {
 
-  constructor() {}
+  safeHTML: SafeResourceUrl|undefined
+  constructor(private domSan:DomSanitizer) {
+    this.safeHTML = domSan.bypassSecurityTrustHtml(``)
+  }
+  openGit(){
+    window.open(`http://git.fmode.cn:3000/nkkj/study-ng-user`,"_blank")
+  }
 
 }

+ 2 - 2
src/app/tabs/tabs.page.html

@@ -5,11 +5,11 @@
       <ion-icon aria-hidden="true" name="triangle"></ion-icon>
       <ion-label>说明</ion-label>
     </ion-tab-button>
-
+<!-- 
     <ion-tab-button tab="tab2" href="/tabs/tab2">
       <ion-icon aria-hidden="true" name="ellipse"></ion-icon>
       <ion-label>示例</ion-label>
-    </ion-tab-button>
+    </ion-tab-button> -->
 
     <ion-tab-button tab="tab3" href="/tabs/tab3">
       <ion-icon aria-hidden="true" name="square"></ion-icon>