星期一, 6月 14, 2021

localstorage 子網域共用的可能性?

https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

星期四, 6月 10, 2021

Angular 1.5 觸發表單驗證

常用的方法,簡單的表單驗證由控制器觸發


//submit後觸發驗證
$scope.validateByManual = function(form) {
logger.debug('validate');
angular.forEach(form, function (control, name) {

// Excludes internal angular properties
if (typeof name === 'string' && name.charAt(0) !== '$') {

logger.debug('field name:' + name);
// To display ngMessages
control.$setTouched();
control.$setDirty();

// Runs each of the registered validators
control.$validate();
}
});
}

其他你感興趣的文章

Related Posts with Thumbnails