src code

class ActiveSupport.Initializer

Description

Several asynchronous events occur in an ActiveJS application before your application is ready to use. The initializer ensures that ActiveRoutes and ActiveRecord are configured appropriately and that these events occur in the correct order. Specifically the initializer will:

  • observe the document 'ready' event provided by ActiveSupport.Element
  • connect ActiveRecord to a data source
  • configure ActiveView.Routing
new ActiveSupport.Initializer({
    database: 'path/to/db.json',
    routes: function(){
        return {
            '/': [MyApp.ViewOne,'index'],
            '/about': [MyApp.ViewTwo,'about']
        };
    },
    callback: function(){
        MyApp.setup();
    }
});

Instance properties