View on GitHub

marymafa.github.io


layout: post title: Research date: 2017-12-07 —

Abstracting into a library

Proxy ensures that functions are executed in the local context, which is a useful pair term for the event callback . The include functions is just a shortcut for adding propertied on the controller.

Loading controllers after the document

Some parts of our controller are bing loaded before the DOM, and other parts in the callback to be invoked after the page’s document has loaded. this can be confusing because the controller’s logic is being executed under under different states , resulting in a lot of document load callbacks.

Loading controllers after the document

The controller class does not need to be constructor functions because the conveter switch needed when generating subcontrollers. Controller .create function to create controller, passing in an object literal of instance properties.

Accessing views

The elementd inside the view then use classes rather is’s , so they do not conflict with elements in other views. Refresh element expect every controller to have a current element property which will scope any selector. Once the refresh element is called the this.search form and this.search input properties will be selt on the controller and are subsequently available for event binding and dom.