search

Home  >  Q&A  >  body text

angular.js - The output content of ng-bind-html contains <input> and can be input. How can I prevent input of <input>?

The rich text box uses text-angular, and the display uses ng-bind-html output

When editing, I copied a section of the page content into it. Because it is a form, I also copied the input box into it,

When displayed, you can still edit in the input box:

Solution requires that the input box can be copied in when editing, but no further input can be made in the input box during display.

大家讲道理大家讲道理2812 days ago1009

reply all(2)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-15 17:00:34

    After the content is loaded, find the element that needs to be restricted and add the readonly or disabled attribute.

    reply
    0
  • 阿神

    阿神2017-05-15 17:00:34

    Input has a readonly attribute

    <input type="text" readonly="readonly" /> 
    

    That’s good

    reply
    0
  • Cancelreply