Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created April 16, 2018 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/00be05a77c5f328a08b28381c42889cb to your computer and use it in GitHub Desktop.
Save goofmint/00be05a77c5f328a08b28381c42889cb to your computer and use it in GitHub Desktop.
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