src/openui5-todo-app/controller/Main.controller.js
/**
       * Update number of not completed items.
       * @private
       */
Update number of not completed items.
@private
Update number of not completed items . @private
_updateItemsLeft() {
        const oViewModel = this.getViewModel()
        const oTodoModel = this.getView().getModel('todo')
        const aTodoItems = oTodoModel.getProperty('/items')
        const aTodoItemsLeft = aTodoItems.filter(oItem => !oItem.isCompleted)
        oViewModel.setProperty('/Main/itemsLeft', aTodoItemsLeft.length)
      }
_updateItemsLeft ( ) { const oViewModel = this . getViewModel ( ) const oTodoModel = this . getView ( ) . getModel ( 'todo' ) const aTodoItems = oTodoModel . getProperty ( '/items' ) const aTodoItemsLeft = aTodoItems . filter ( oItem => ! oItem . isCompleted ) oViewModel . setProperty ( '/Main/itemsLeft' , aTodoItemsLeft . length ) }
Update number of not completed items.
Update number of not completed items .
// calculate how many items are left // update view model