Skip to content
LeuisKen edited this page Nov 21, 2015 · 2 revisions

#StarMVC Document


Class: star

The constructor of StarMVC.

star.addRoute(route, templete, controller)

Add route in the route table.

Parameters

route: string, the name of the route

templete: string, the path of the view templete

controller: function, the container of the data that will render in the templete.

star.init(viewElement)

Initialize the StarMVC application.

Parameters

viewElement: string, the DOM object that you templete will render in

star.startApp()

Start the StarMVC App.

star.loadTemp(route)

Load the templete that will be renderd, use ajax.

Parameters

route: object, the route object that contains the required information.

star.renderTemp(rawTemp, controller)

The core of the templete engine.

Parameters

rawTemp: string, the templete.

controller: function, the container of the data that will render in the templete.

star.render()

Render the DOM tree in the view.