Ng-quill Doesn't Block Textarea Of Quill Editor When ReadOnly Flag ...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <link data-require="quill@*" data-semver="1.3.6" rel="stylesheet" href="https://cdn.quilljs.com/1.3.6/quill.snow.css" /> <script data-require="quill@*" data-semver="1.3.6" src="https://cdn.quilljs.com/1.3.6/quill.js"></script> <link data-require="angular.js@1.7.8" data-semver="1.7.8" rel="stylesheet" href="https://code.angularjs.org/1.7.8/angular-csp.css" /> <script data-require="angular.js@1.7.8" data-semver="1.7.8" src="https://code.angularjs.org/1.7.8/angular.min.js"></script> <script data-require="angular.js@1.7.8" data-semver="1.7.8" src="https://code.angularjs.org/1.7.8/angular-sanitize.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/ng-quill/4.4.0/ng-quill.js"></script> <script src="app.js"></script> </head> <body ng-app="quillReadOnlyExample"> <quill-read-only-test></quill-read-only-test> </body> </html> (function(angular) { 'use strict'; angular.module('quillReadOnlyExample', ['ngQuill', 'ngSanitize']) .component('quillReadOnlyTest', { controller: 'QuillReadOnlyTestController', controllerAs: 'vm', templateUrl: 'quill-read-only-test.html' }) .controller('QuillReadOnlyTestController', ['$scope', function($scope) { var vm = this; vm.$onInit = function() { console.log('Controller inited!'); vm.readOnly = false; vm.getPlaceholder = getPlaceholder; vm.text = ''; vm.onQuillCreated = onQuillCreated; $scope.$watch('doesntMatterWhat', function() { vm.readOnly = true; console.log('Flag changed!') }) } function getPlaceholder() { if (vm.readOnly) { return 'You can only read'; } else { return 'You can read and write'; } } function onQuillCreated(quillInstance) { console.log('Quill created!'); } }]); })(window.angular); <ng-quill-editor format="text" on-editor-created="vm.onQuillCreated(editor)" placeholder="vm.getPlaceholder()" read-only="vm.readOnly" ng-model="vm.text"></ng-quill-editor> <div> <span>Read only:</span> <span ng-bind="vm.readOnly"></span> </div> <div ng-if="vm.readOnly" style="color: red">You should not be able to write!</div> <div ng-if="!vm.readOnly" style="color: green">You can write</div> <button ng-click="vm.readOnly = !vm.readOnly">Change flag</button>
Từ khóa » Ng Quill
-
Ng-quill - Npm
-
Ngx-quill - Npm
-
Ng-quill/ml At Master - GitHub
-
Ng-quill-example - CodePen
-
Ng-quill - UNPKG
-
Use Ng Quill In AngularJs Project - Text Editor - Stack Overflow
-
Ng-quill Vulnerabilities - Snyk
-
Quickstart - Quill Rich Text Editor
-
Ng-quill - Libraries - Cdnjs - The #1 Free And Open Source CDN Built ...
-
Ng Quill Editor (forked) Starter Project For Angular Apps ... - StackBlitz
-
NG-QUILL CDN Links - CDNPKG .com
-
Ngx-quill Examples - CodeSandbox
-
Ng-quill CDN By JsDelivr - A CDN For Npm And GitHub
-
Tích Hợp Trình Soạn Thảo Văn Bản Quill Trong Một ứng Dụng Angular