A "view component" is the central initialiation method called as the first act of every Fluid component. This function automatically merges user options with defaults, attaches a DOM Binder to the instance, and configures events. Alternatively, a "view component" is composed of a "little component", "model component", and an "evented component".
||(Object) The component name|
||(Object) The component container|
||(Object) The component options|
|Object||A module with merged options, DOM Binder and configured events|
We want to create an Uploader view component containing a sub-component that identifies the correct uploading strategy for our progressively-enhanced uploader. The Uploader view component can be instantiated in two different ways. See the following examples below:
A direct call to the framework API:
Indirect IoC-driven approach:
A component grade is required by setting the gradeNames property to "fluid.viewComponent". The "autoInit" grade is included so that the component's actual creator function doesn't need to be written at all.