Application structure - jasperjs/jasper-application GitHub Wiki
Jasper is a tiny framework that wraps AngularJS to provide component approach for creating rich JavaScript applications.
Jasper hides following deprecated AngularJS API:
- directive definition object
- $scope
- ng-controller, ng-include...
- jqLite
- modules
Jasper application consists of the following units:
Component - a custom HTML element that encapsulates its own template and behaviour.
<my-button text="Press me" type="danger"></my-button>Decorator component - a custom HTML attribute that adds functionality to an HTML element. For instance, it may be an attribute that puts selection to the contents of an input element when it gains focus:
<input type="text" select-on-focus />Service - a class that encapsulates some application logic. For instance, a service may call remove APIs or do some calculations.
Filter - an AngularJS filter. Filters are commonly used to format values in templates. For instance, formatting a number as price:
<p>
{{cart.total | price}}
</p>Page - a component that represents an application page with its own route and a code-behind file. At the build time the grunt-jasper task registers a page as a component and adds a route to JasperRouteProvider.
Area - a subset of the components listed above which can be loaded asynchronously at runtime. Areas are used to split large applications into parts and load them on demand.