src/openui5-todo-app/controller/Main.controller.js
/**
       * Called when the controller is instantiated.
       * @public
       */
Called when the controller is instantiated.
@public
Called when the controller is instantiated . @public
onInit() {
        this.initViewState({
          selectedFilter: 'all',
          newTodoItemName: '',
          itemsLeft: 0,
          timestamp: moment().format('MMM Do YY')
        })
        this.getRouter()
          .getRoute('root')
          .attachMatched(this.onRouteMatched, this)
        this.getRouter()
          .getRoute('todo')
          .attachMatched(this.onRouteMatched, this)
      }
onInit ( ) { this . initViewState ( { selectedFilter : 'all' , newTodoItemName : '' , itemsLeft : 0 , timestamp : moment ( ) . format ( 'MMM Do YY' ) } ) this . getRouter ( ) . getRoute ( 'root' ) . attachMatched ( this . onRouteMatched , this ) this . getRouter ( ) . getRoute ( 'todo' ) . attachMatched ( this . onRouteMatched , this ) }
Called when the controller is instantiated.
Called when the controller is instantiated .
// init view state (accassible via {view>/Main/...}) // listen to relevant routes pointing to our view