Generating api docs and added ngAnimate
diff --git a/views/ngXosLib/.gitignore b/views/ngXosLib/.gitignore
index bb93d68..9b2df09 100644
--- a/views/ngXosLib/.gitignore
+++ b/views/ngXosLib/.gitignore
@@ -1,2 +1,3 @@
node_modules
-bower_components
\ No newline at end of file
+bower_components
+docs
\ No newline at end of file
diff --git a/views/ngXosLib/README.md b/views/ngXosLib/README.md
index cfce430..3da0271 100644
--- a/views/ngXosLib/README.md
+++ b/views/ngXosLib/README.md
@@ -10,9 +10,9 @@
Usage: `npm run apigen`
-This tool will automatically generate an angular resource file for each endpoint available in Swagger.
+This tool will automatically generate an angular resource file for each endpoint available in Apiary.
->You can generate api related documentation with: `npm run apidoc`. The output is locate in `api/docs`. You can have a list of available method also trough Swagger at `http://localhost:9999/docs/`
+>You can generate api related documentation with: `npm run doc`. The output is locate in `api/docs`. You can have a list of available method also trough Apiary at `http://docs.xos.apiary.io/#`
### Vendors
@@ -21,9 +21,10 @@
- angular-route
- angular-resource
- angular-cookie
+- angular-animate
- ng-lodash
-This libraries are server through Django, so they will not be included in your minified vendor file. To add a library and generate a new file (that will override the old one), you should:
+This libraries are served through Django, so they will not be included in your minified vendor file. To add a library and generate a new file (that will override the old one), you should:
- enter `ngXosLib` folder
- run `bower install [myPackage] --save`
- rebuild the file with `gulp vendor`
@@ -45,9 +46,6 @@
It will automatically ad a `token` to all your request, eventually you can take advantage of some other services:
- **NoHyperlinks Interceptor**: will add a `?no_hyperlinks=1` to your request, to tell Django to return ids instead of links.
-- **XosApi** wrapper for `/xos` endpoints.
-- **XoslibApi** wrapper for `/xoslib` endpoints.
-- **HpcApi** wrapper for `/hpcapi` endpoints.
>_NOTE: for the API related service, check documentation in [Apigen](#apigen) section._
@@ -85,7 +83,7 @@
To install a local dependency use bower with `--save`. Common modules are saved in `devDependencies` as they already loaded in the Django template.
-The `npm start` command is watching your dependencies and will automatically inject it in your `index.html`.
+The `npm start` command is watching your dependencies and will automatically inject them in your `index.html`.
#### Linting
@@ -98,6 +96,4 @@
## TODO
-- Use Angular $resource instead of $http
-- Use ngDoc instead of jsDoc
- Define styleguide (both visual and js) and if needed define some UI components
\ No newline at end of file
diff --git a/views/ngXosLib/bower.json b/views/ngXosLib/bower.json
index 71777ba..3726b85 100644
--- a/views/ngXosLib/bower.json
+++ b/views/ngXosLib/bower.json
@@ -18,7 +18,8 @@
"angular-ui-router": "0.2.15",
"angular-resource": "1.4.7",
"ng-lodash": "0.3.0",
- "angular-cookies": "1.4.7"
+ "angular-cookies": "1.4.7",
+ "angular-animate": "1.4.7"
},
"devDependencies": {
"angular-mocks": "1.4.7"
diff --git a/views/ngXosLib/generator-xos/app/templates/bower.json b/views/ngXosLib/generator-xos/app/templates/bower.json
index d8f456f..721e2de 100644
--- a/views/ngXosLib/generator-xos/app/templates/bower.json
+++ b/views/ngXosLib/generator-xos/app/templates/bower.json
@@ -22,6 +22,7 @@
"angular": "1.4.7",
"angular-ui-router": "0.2.15",
"angular-cookies": "1.4.7",
+ "angular-animate": "1.4.7",
"angular-resource": "1.4.7",
"ng-lodash": "0.3.0",
"bootstrap-css": "3.3.6"
diff --git a/views/ngXosLib/gulp/ngXosHelpers.js b/views/ngXosLib/gulp/ngXosHelpers.js
index cc68513..407d70e 100644
--- a/views/ngXosLib/gulp/ngXosHelpers.js
+++ b/views/ngXosLib/gulp/ngXosHelpers.js
@@ -1,8 +1,9 @@
var gulp = require('gulp');
var uglify = require('gulp-uglify');
-var concat = require("gulp-concat");
+var concat = require('gulp-concat');
var ngAnnotate = require('gulp-ng-annotate');
var angularFilesort = require('gulp-angular-filesort');
+var gulpDocs = require('gulp-ngdocs');
module.exports = function(options){
gulp.task('helpers', function(){
@@ -13,4 +14,16 @@
.pipe(uglify())
.pipe(gulp.dest(options.ngXosVendor));
});
+
+ gulp.task('docs', function(){
+ return gulp.src(options.xosHelperSource + '**/*.js')
+ .pipe(gulpDocs.process({
+ title: 'XOS Helpers Module',
+ scripts: [
+ 'http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js',
+ 'http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-animate.min.js'
+ ]
+ }))
+ .pipe(gulp.dest('./docs'));
+ });
};
\ No newline at end of file
diff --git a/views/ngXosLib/package.json b/views/ngXosLib/package.json
index 8804013..246028f 100644
--- a/views/ngXosLib/package.json
+++ b/views/ngXosLib/package.json
@@ -7,7 +7,7 @@
"test": "karma start",
"apigen": "node apigen/blueprintToNgResource.js",
"swagger": "node xos-swagger-def.js",
- "apidoc": "jsdoc api/ng-xos.js api/ng-xoslib.js api/ng-hpcapi.js -d api/docs",
+ "doc": "gulp docs; cd ./docs; http-server -o",
"build": "gulp vendor && gulp helpers"
},
"author": "Matteo Scandolo",
@@ -29,7 +29,9 @@
"gulp-angular-filesort": "^1.1.1",
"gulp-concat": "^2.6.0",
"gulp-ng-annotate": "^1.1.0",
+ "gulp-ngdocs": "^0.2.13",
"gulp-uglify": "^1.4.2",
+ "http-server": "^0.9.0",
"jasmine-core": "^2.4.1",
"karma": "^0.13.19",
"karma-babel-preprocessor": "^6.0.1",
diff --git a/views/ngXosLib/xosHelpers/src/xosHelpers.module.js b/views/ngXosLib/xosHelpers/src/xosHelpers.module.js
index eb9222c..d7cd958 100644
--- a/views/ngXosLib/xosHelpers/src/xosHelpers.module.js
+++ b/views/ngXosLib/xosHelpers/src/xosHelpers.module.js
@@ -1,6 +1,6 @@
(function() {
'use strict';
- console.log('XOS Helpers Module')
+
angular.module('bugSnag', []).factory('$exceptionHandler', function () {
return function (exception, cause) {
if( window.Bugsnag ){
@@ -12,6 +12,12 @@
};
});
+ /**
+ * @ngdoc overview
+ * @name xos.helpers
+ * @description this is the module that group all the helpers service and components for XOS
+ **/
+
angular
.module('xos.helpers', [
'ngCookies',