Request some guidance on how to include a common footer template (say the copyright footer) across the app.
I tried a few things like ion-toolbar, multiple ion-nav with appropriate “content” name etc. but nothing worked so far.
Thanks in advance.
thanks a lot luukschoen!
But when i try that, the tool bar is showing up in the top and also the menu icon is lost!
I have attached the screen shot for the app.html code below:
<ion-menu side=“right” [content]=“content”>
Hm that’s a weird one. Could you set up a codepen to show us your problem? If I try the following code in a blank page, everything happens as expected;
hi @luukschoen, @icarus_31
I have just set up the 2 files viz. app.html & app.ts through http://codepen.io/mohanb02/pen/pywLgo.
Haven’t set up the other dependent files. will this still let you take a look at the files and suggest some approach or should i do something better in codepen? Let me know.
@icarus_31:
Thanks! yes. if the footer is injected into a specific template it works, but i am looking at using it in a place so that the footer need not be injected in every template! I felt that should be feasible, but not able to get it right :).
@bandito:
thanks! will this be a common footer injection across templates?
Ahhh so you want one global defined toolbar at the bottom… 'Just like putting it in the index.html in Ionic 1, a global footer. I guess that isn’t working (for now). Most logical place would be in app.html, but then (as you experienced) it won’t obey the position=“bottom”. I don’t know if it’s by design or just a bug or feature not yet implemented, but you’re absolutely right.
I suggest you make 1 footer component and add all the html you need for the footer in that template. Inject the small piece of directive html into every template where you need your footer… I know it isn’t exactly the DRY solution you’re looking for, but at least it solves your problem and keeps the code you need to change if you wan’t to change your footer to a minimum.
yes you just create a custom component, add a ion-footer at the bottom of each page you want it on and include your custom component. This keeps all your footer code in the custom component.
Yeah, I got it to work shortly after posting here.
I did something even simpler, which was to include the footer in app.html and its component code in app.component.ts. Only hiccup was that I had to create an app.component.scss file in the same directory to get the CSS to work, global.scss does not seem to work, as noted elsewhere in this forum… otherwise, it works great!