2018年11月30日 星期五

輸入欄位不要自動跳出建議

此問題因瀏覽器版本跟使用者電腦而異,所以同一個畫面同一個欄位有的人會遇到有的人不會

<input dont-fill type="tel" class="form-control" />

.directive('dontFill', function () {
        return {
            restrict: 'A',
            link: function link(scope, el, attrs) {
                // password fields need one of the same type above it (firefox)
                var type = el.attr('type') || 'text';
                // chrome tries to act smart by guessing on the name.. so replicate a shadow name
                var name = el.attr('name') || '';
                var shadowName = name + '_shadow';
                // trick the browsers to fill this innocent silhouette
                var shadowEl = angular.element('<input type="' + type + '" name="' + shadowName + '" style="display: none">');

                // insert before
                el.parent()[0].insertBefore(shadowEl[0], el[0]);
            }
        };
    })

沒有留言:

自訂權限驗證機制

// 使用 filter [Route("api/[controller]")] [ApiController] [Authorize] [TypeFilter(typeof(CustomAsyncAuthorizationFilter))] public c...