Skip to content

emismith90/aa.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

What is aa.js

Truly an 'atomic' (2.85 KB) javascript application framework.

What is inside the box

  • Event aggregator by injecting ['$aquarium'] (aquarium.js)
  • Dependency injection by default and programatically by injecting ['$injector']

Installation

bower install aa.js

Usage

var app = new AtomicApp();

app.use('jquery', jQuery)
   .use('serviceA', [function () {
        return {
            greeting: function (name) {
                return 'Hello ' + name;
            }
        };
   }])
   .use('serviceB', ['serviceA', function (a) {
        return {
            print: function () {
                console.log(a.greeting('Hung.Le'));
            }
        }
   }])
   .run('main', ['jquery', 'serviceB', '$injector', function ($$, b, $injector) {
        b.print();
        
        if ($$) {
            // jQuery is loaded  
            alert("jQuery!");
        } 
        
        var $aquarium = $injector.resolve('$aquarium');
   }]);

Released under the MIT license

About

Truly an `atomic` JS application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published