This tutorials provide the BajaScript&Require&Backbone walkthrough.
- how to start your application with Require
- how to develop your application using BajaScript based on Require
- how to retrieve folders/control points
- how to subscribe the changes of control point
- how to invoke the action of control point (current just for NumericWritable)
- how to use Handlebars template engine via Require plugin
- copy the above tutorials folder to your [Daemon User Home]\stations[YOUR STATION]\shared;
- current the example will display the folders under station:|slot:/poc, so you need to create these folders in your workbench;
- visit https://localhost/file/tutorials/intro/index.html
- how to develop your application using BajaScript based on Backbone
Model | View |
---|---|
Orchestrates data and business logic | Listens for changes and renders UI |
Loads and saves from the server | Handles user input and interactivity |
Emits events when data changes | Sends captured input to the model |
A Collection helps you deal with a group of related models, handling the loading and saving of new models to the server and providing helper functions for performing aggregations or computations against a list of models. Aside from their own events, collections also proxy through all of the events that occur to models within them, allowing you to listen in one place for any change that might happen to any model in the collection.
- how to manage the subviews
views/home.js -> Home page view including some subviews
views/page1.js -> Page one view - how to route page views
routers/router.js -> AppRouter for application - how to integrate baja.Subscriber events with Backbone (changed, renamed, added, removed)
collections/points.js -> baja Subscriber - how to use application-level event manager for event-based communication
app.js -> Define the application-level event manager - how to avoid memory leaks about pub/sub mechanism
views/app.js -> Release the resources of views
views/home.js -> Release the resources of subviews, baja unsubscribe and detach