js/
- index.html
- controller.js
angular.module('Application', ['ModuleA', 'AppViewACtrl', 'lodash', function(){}]);
- dependencyFactory.js
var lodash = angular.module('lodash', []); lodash
.factory('_', function() {
| /* | |
| DIRECTORY STRUCTURE | |
| module1.js | |
| module2.js | |
| module2/ | |
| - model.js | |
| - view1.js | |
| - view2.js |
| /* Module */ | |
| define(['dep'], function(dep){ | |
| var Module = {}; | |
| // Instantiate a local controller | |
| Module.controller = new Backbone.Controller.extend({ | |
| foo: bar | |
| })(); |
| //New constructor | |
| var cons = function(){ | |
| var property_private = 'bye'; | |
| this.property_public = 'see ya'; | |
| //Instead of returning this, return only what needs | |
| //to be accessible | |
| return { | |
| property_public: this.property_public, | |
| method_public: function(){ |
| Timeseries format | |
| { | |
| device_legend: [device1, device2], | |
| data_legend: [[dataType1, dataType2], [device2_dataType1]], | |
| data: [ | |
| { | |
| x: timestamp, | |
| y: [ | |
| [ |
| //Log events fired on given DOM element | |
| monitorEvents(elem); | |
| unmonitorEvents(elem); | |
| //See a trace of how we reached this line. | |
| console.trace(); | |
| //Performance timing | |
| console.time('Timer'); | |
| console.timeEnd('Timer'); |
| # Add multiple servers at different ports for load balancing | |
| upstream node { | |
| server 127.0.0.1:3005; | |
| } | |
| # the nginx server instance | |
| server { | |
| listen 0.0.0.0:80; | |
| server_name {{ your_app_name }} {{ your.domain.com }}; | |
| access_log /var/log/nginx/{{ your.domain.com }}.log; |
| define([ | |
| 'jquery', | |
| 'underscore', | |
| 'backbone', | |
| 'backbone.marionette', | |
| 'backbone.virtual-collection', | |
| 'hbs!navigation/templates/list', | |
| 'hbs!navigation/templates/listItem' | |
| ], function( |
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: intelligentarray | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Uses forever to manage the node.js application | |
| # Description: Launches a node.js application using forever. | |
| ### END INIT INFO |
js/
angular.module('Application', ['ModuleA', 'AppViewACtrl', 'lodash', function(){}]);var lodash = angular.module('lodash', []);
lodash
.factory('_', function() {
| <!-- This assumes you are using ngResource to request data (http://docs.angularjs.org/api/ngResource.$resource) --> | |
| <ul> | |
| <!-- | |
| We can use ng-show="{expression}" to programmatically display something. | |
| ngResouce adds a handy $resolved property to your data objects. | |
| So, let's key off of that to indicate loading | |
| --> | |
| <li ng-show="!things.$resolved">Loading...</li> |