HTML5手機APP開發入(4)
課程內容
完成一個自定義的Component用來展現通訊錄使用者的明細資訊如下圖
http://bootsnipp.com/snippets/featured/profile-card
涉及的知識點:
Component的定義,輸入/輸出
步驟
新建一個Component檔案定義contactinfo.html
HTML 程式碼從http://bootsnipp.com/snippets/featured/profile-card 複製過來
新建一個contactinfo.ts
使用關鍵字Component,selector對應HTML TAG,angular2 定義一個component比angular 1要簡單的多
引用或稱註冊這個Component
修改 detail-item.ts
import {UserInfoComponent} from './components/contactinfo';
directives:[UserInfoComponent],
非常的簡單
RUN Test
Perfect!
下次再做一個登入頁面基本的功能就完成,HTML5做移動開發真的非常的簡單,難得可能就是UI的設計和使用者體驗