For
small applications / pages we can have the controller script embedded in the
HTML page within the script tags, however if the application / page is large
and complex then it is advisable to maintain the controller in separate .js
files. Also by doing so we can maintain multiple controllers on a single page.
The following sample demonstrates a simple page, where the HTML View and the controllers are maintained in 2 different files
The following sample demonstrates a simple page, where the HTML View and the controllers are maintained in 2 different files