ionic4 カスタムコンポーネントの作り方
今回やりたいこと
・<my-tag></my-tag>で呼び出せるコンポーネントを作りたい
・specファイルは作らない
プロジェクト作成
$ ionic start component_test blank $ cd $_
コンポーネント作成
$ ionic generate component components/my-tag --nospec
src/app/home/home.module.ts
・・・ import { MyTagComponent } from '../components/my-tag/my-tag.component'; @NgModule({ ・・・ declarations: [HomePage, MyTagComponent] // MyTagComponentを追加 })
src/app/home/home.page.html
<!-- 呼び出し --> <app-my-tag></app-my-tag>
以上です