This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
angular.module("amks", ['ui.router', 'restangular', 'aluno']) | |
.run(congiruarApp) | |
.factory('authInterceptor', Interceptador) | |
.config(adicionarInterceptador); | |
congiruarApp.$inject = ['Restangular']; | |
function congiruarApp(restangular) { | |
restangular.setBaseUrl('/api'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create HTTP interceptor (https://docs.angularjs.org/api/ng/service/$http - Interceptors topic) | |
App.factory('AuthInterceptor', ['$window', '$q', '$location', function ($window, $q, $location) { | |
return { | |
request: function (config) { | |
config.headers = config.headers || {}; | |
config.headers.ContentType = 'application/json; charset=UTF-8'; | |
if (myGlobalVar.getToken()) { | |
// populate header custom fields | |
config.headers.Authorization = 'Bearer ' + myGlobalVar.getToken().access_token; | |
config.headers.iduser = myGlobalVar.getToken().iduser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Intercept all requests /responses | |
* Ej. use to auth-tokens in headers | |
*/ | |
angular.module('cInterceptor', []) | |
.factory('cInterceptor', ['$q', '$rootScope', function ($q, $rootScope) { | |
return { | |
'request': function (config) { | |
config.headers = config.headers || {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['jquery', 'message'], function($, scojs_message) { | |
'use strict'; | |
/** | |
* The image upload directive | |
* @author: kehefu | |
* @version: 0.1.0, 2016-12-27 | |
*/ | |
var uploadModule = angular.module('upload', []); | |
uploadModule.directive('upload', ['$window', function($window) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/ | |
# GitLab uses docker in the background, so we need to specify the | |
# image versions. This is useful because we're freely to use | |
# multiple node versions to work with it. They come from the docker | |
# repo. | |
# Uses NodeJS V 9.4.0 | |
image: node:9.4.0 | |
# And to cache them as well. |