decentraleyes-client-angularjs v0.0.17
decentraleyes-client-AngularJS
Decentraleyes.net AngulaJS Client Services reference implementation
Architecture
Every service in Decentraleyes.net is shipped as a standalone module to allow SysOps the freedom to:
- Determine whether or not they use each module;
- Determine when/if they upgrade them; and
- Change or even entirely rewrite them from scratch.
Each service module implements an interface made of public methods and routes. If the public interface is maintained, Decentraleyes.net doesn't care what amount of actual work is performed within the service as long as it succeeds and generates a result expected by the user per the documented interface contract of the service.
For example, a SysOp might not want to use MongoDB or might even want to use a database they created. Such a user could create a new service and write the logic needed to use their custom database while providing service as expected through Decentraleyes.net including beacons, notifications and so on.
Building
grunt build
will populate the dist directory with an optimized and minified build of this module's web content. The dist directory will be served by the module if NODE_ENV is "production".
Development
grunt serve
in this module's root directory will start an interactive development session, open your default web browser and automatically refresh content in the browser as you make changes.
Yeoman can and should be used to create new routes, directives, views, scripts, etc. yo angular:route test-route
will create the /test-route
AngularJS route and populate it with a controller, test and view. Yeoman does more than that, but that's the quick-start.
Methods
The decentraleyes-users module offers publicly callable JavaScript methods used by code, not by HTTP requests.
load (express, mongoose, app)
Loads the service and configures it for use. The load method compiles the schema and model. Then, it attaches the service's routes to the host application's call chain.