例如要自定義一個component:
用于顯示一個有固定結構的item組成list
假設這是我們要的一個item的效果:
item1
item2
item3
1.在終端中執行:ionic g component mycomponent
執行後src目錄中會出現components目錄,其中有我們剛剛建立的my-component目錄,打開後有scss、ts、html和module.ts檔案如圖(圖中這個元件的名字叫chapterlist)
src:

my-component.html:
my-component.ts: