search

Home  >  Q&A  >  body text

angular.js - I would like to ask, how does Angular realize that when editing content without clicking Save, you can still see the content you edited when you return?

Excuse me, how can Angular realize that when editing content without clicking Save, you can still see the content you edited when you return?

大家讲道理大家讲道理2781 days ago581

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:07:57

    Listen to the input event, save the entered content to localstorage, and load the content in localStroage when loading the page.

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-15 17:07:57

    You can tie the ng-model of input to the data model of rootscope, so that the data can be retained when the front-end virtual router switches pages.

    reply
    0
  • Cancelreply