Splitting cmds in services
Change-Id: I7caaf9807f28ada80b82df2bd8afa3d6ed3b0caa
diff --git a/views/ngXosViews/UITutorial/src/js/errorHandler.js b/views/ngXosViews/UITutorial/src/js/errorHandler.js
new file mode 100644
index 0000000..dbe41f4
--- /dev/null
+++ b/views/ngXosViews/UITutorial/src/js/errorHandler.js
@@ -0,0 +1,10 @@
+(function () {
+ 'use strict';
+ angular.module('xos.UITutorial')
+ .service('ErrorHandler', function(){
+ this.print = (msg, done) => {
+ const errorTpl = _.template(`<span class="error">[ERROR] <%= msg %></span>`);
+ done(errorTpl({msg: msg}));
+ };
+ });
+})();
\ No newline at end of file