Skip to content

This tutorials provide the BajaScript&Require&Backbone examples.

License

Notifications You must be signed in to change notification settings

hanshu/bajascript-tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorials

This tutorials provide the BajaScript&Require&Backbone walkthrough.

1. intro

  • how to start your application with Require
  • how to develop your application using BajaScript based on Require
    1. how to retrieve folders/control points
    2. how to subscribe the changes of control point
    3. how to invoke the action of control point (current just for NumericWritable)
  • how to use Handlebars template engine via Require plugin

How to run this example:

  1. copy the above tutorials folder to your [Daemon User Home]\stations[YOUR STATION]\shared;
  2. current the example will display the folders under station:|slot:/poc, so you need to create these folders in your workbench;
  3. visit https://localhost/file/tutorials/intro/index.html

2. backbone

  • 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.

3. advanced

  • 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

About

This tutorials provide the BajaScript&Require&Backbone examples.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published