Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Apr 16, 2018
Embed
What would you like to do?
ons.ready(() => {
resolveVariable(['Tab1Controller', 'Tab2Controller'])
.then(() => {
// 変数定義済み
});
});
const resolveVariable = (ary) => {
return new Promise((res, rej) => {
setTimeout(() => {
let bol = true;
for (let index in ary) {
if (!(ary[index] in window)) {
bol = false;
return resolveVariable(ary)
}
}
if (bol) res();
}, 100);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment