Reusing code in all templates


#1

I have got this HTML code for displaying notifications. That should be used in every view. But i’m unsure on how I would do something like that in Ionic.

 <div class="notification">
        <img src="{{ notification?.image }}">
        <span>{{ notification?.title }}</span>
        {{ notification?.content }}
 </div>

Can anyone point me in the right direction?


#2

Create a component. Then you can reuse the code/component in all your pages/views.