Angular formal read-only mode for radio, multiCheckbox and checkbox

I need to display the form in read-only mode, I am creating a Json based form using angular -formly. Check out the http://angular-formly.com/#/example/other/read-only-form link that works for text input, please suggest how to set read-only for radio, multichannel cell and checkbox

+4
source share
1 answer

we do this through jQuery:

   $(document).ready(function () {
            $('input').click(function (e) {
                e.preventDefault();
            });
        });

, "", "angular", , jQuery , (, jQuery angular.element - "" jQuery --- angular: https://docs.angularjs.org/api/ng/function/angular.element), :

   angular.element(function() {
        angular.element('input').trigger('click')(function(e) {
            e.preventDefault();
        };
   });

, , : " angular jQuery ", , , -.

. datepickers .., - readOnly , , , , ng-show : ng-show="!model.readOnly"

0

Source: https://habr.com/ru/post/1608309/


All Articles