Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Apr 16, 2018
Embed
What would you like to do?
const appController = {
__name: 'AppController',
_tab1Controller: Tab1Controller,
_tab2Controller: Tab2Controller,
__ready() {
},
'{rootElement} changeTitle'(context) {
let back = '';
if (context.evArg.back) {
back = `<div class="left">
<ons-back-button id="backButton">Back</ons-back-button>
</div>`;
}
const outerHTML = ons.createElement(`
<ons-toolbar id="toolbar">
${back}
<div class="center">${context.evArg.title}</div>
</ons-toolbar>
`);
this.$find('#toolbar').prop('outerHTML', outerHTML.outerHTML);
},
'#tabbar prechange'() {
this.trigger('changeTitle', {
title: "メイン",
back: false
});
}
};
h5.core.controller('body', appController);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment