5
Hello,
I am new to development and would like to know if there is any way to hide information from variables in Angularjs , I am using a Mongolab API and did not want to make my apiKey visible to anyone who debug the code in the browser, I am running the application with Nodejs and Expressjs , the server code was generated through the ExpressJS CLI
in that way: npm install express-generator -g
and soon after express meuApp
.
Follows code from controller:
app.controller("RBScontroller", function ($scope, $http) {
$scope.enviar = function enviar(){
var ApiMongo = 'https://api.mongolab.com/api/1/databases/db_test/collections/users?apiKey=Chave_da_APi'; //Gostaria de esconder essa informação
$scope.users = [];
$scope.loading = true;
$http.get(ApiMongo).success(function(data) {
console.log(data);
$scope.users = data;
$scope.loading = false;
}).error(function(msg) {
angular.element($(function(){alert("Fail")}));
$scope.loading = false;
});
}
});
Ah, you had already answered that there. The dynamic reading made it impossible for me to see the
http.request
. +1– Wallace Maxters
Thanks man, I’ll research then how does it in Nodejs! ;)
– Rubens Barbosa