Import templates


#1

Hello, I’m trying to import template, not to have to do the same tags to each page.
For example, the code below, a navigation bar with the menu icon, I need to always be rewriting each new html page.
How would I do to write the code below only once, and import it to render in the new pages?

`<ion-navbar *navbar>
      <button menuToggle>
          <ion-icon name="menu"></ion-icon>
      </button>
      <ion-title>Getting Started</ion-title>
</ion-navbar>`

Thank you


#2

Generally, you’ll be a lot happier if you forget the concept of “import” that you may be used to with other templating libraries.

It’s hard to say exactly what would make the most sense for your app without knowing the complete page hierarchy. Can you add this common boilerplate to the template for your application component?


#3

I’m starting now in ionic 2, and as I know there is the import or include templates to reduce oversights and errors, I thought it might have something in ionic 2. But I will follow your advice and be happy :smile: