How to Clear Contents of an observableArray That was Populated from Previous Visits to a View

前端 未结 4 1145
猫巷女王i
猫巷女王i 2021-02-06 20:59

I have a Single Page Application that uses knockout for the data binding. The CAApproval.html view in my single page application has an observeablearray named AllCertificates i

4条回答
  •  攒了一身酷
    2021-02-06 21:35

    Also knockout observableArray has interesting methods. Call removeAll to clear all items.
    Look at official site observable array manual.

    self.mycertificates = ko.observableArray(['C1', 'C2']);  
    self.mycertificates.removeAll();
    

提交回复
热议问题