Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created Aug 12, 2016
Embed
What would you like to do?
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