Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created August 12, 2016 04:42
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/7056e7cd03efb799aba5022aff78fe2c to your computer and use it in GitHub Desktop.
Save goofmint/7056e7cd03efb799aba5022aff78fe2c to your computer and use it in GitHub Desktop.
1.md
this.formController.addRule({
userId: {
customFunc: function(value) {
var dfd = h5.async.deferred();
h5.ajax('existUser', {
// 非同期処理
}).done(function(resp) {
// 入力値に問題なかった場合
dfd.resolve({
// 何かデータがあれば指定
});
// 入力値に問題があった場合
dfd.reject({
// 何かデータがあれば指定
});
});
return dfd.promise();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment