Created
May 23, 2017 13:14
-
-
Save guaracyalima/207f78d7dae626a57ff84725b2e3b750 to your computer and use it in GitHub Desktop.
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(){ | |
app.controller('enricherCtrl', [ | |
'api', | |
'$location', | |
'$scope', | |
'$http', | |
'$state', | |
'$timeout', | |
enricherController | |
]) | |
function enricherController (api, $location, $scope, $http, $state, $timeout) { | |
var vm = this; | |
vm.listFacebook = []; | |
vm.facebook = function(customer) { | |
// let url = `https://api.ubicity.com.br/ss/redes-sociais/facebook?name=JULIANA%20SILVA%20FREIRE`; | |
// $http.get(`${apiUrl}/Feeds/facebook/${customer.name}`) | |
// .then(function(result){ | |
// vm.listFacebook = result.data.data | |
// console.log(vm.listFacebook) | |
// $scope.$apply(); | |
// }) | |
// console.log(vm.listFacebook) | |
// $location.path(`enrichiement/${customer.id}/facebook`) | |
const url = `${apiUrl}/Feeds/facebook/${customer.name}`; | |
const metod = 'GET'; | |
$http({ | |
url: url, | |
method: metod | |
}).then(function success(data){ | |
console.log('Data: ', data.data) | |
vm.listFacebook = data.data.data | |
$scope.apply() | |
console.log('imrpimindo listFacebook dentro ', vm.listFacebook) | |
}, function fail(err){ | |
console.log('Erro', err) | |
}) | |
//$location.path(`enrichiement/${customer.id}/facebook`) | |
} | |
vm.enriching_action = (customer) => { | |
vm.facebook(customer) | |
} | |
} | |
})() |
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
<div ng-controller="enricherCtrl as o"> | |
<section class="content" style="margin:12px 10px"> | |
<div class="row"> | |
<div class="col-md-3" ng-controller="customerCtrl as ctrl"> | |
<div ng-include="'customers/info.html'"></div> | |
<div ng-include="'customers/tels.html'"></div> | |
<!--<div ng-include="'customers/addresses.html'"></div> | |
<div ng-include="'customers/social.html'"></div> --> | |
</div> | |
<!-- /.col --> | |
<div class="col-md-9"> | |
<div class="box"> | |
<div class="box-header with-border"> | |
Enriquecimento | |
</div> | |
<div class="box-body pad "> | |
<a class="btn btn-app"> | |
<i class="fa fa-barcode" aria-hidden="true"></i> | |
Serasa | |
</a> | |
<a class="btn btn-app"> | |
<i class="fa fa-info-circle" aria-hidden="true"></i> | |
Transparência | |
</a> | |
<a class="btn btn-app"> | |
<i class="fa fa-university" aria-hidden="true"></i> | |
Empresas | |
</a> | |
<a class="btn btn-app"> | |
<i class="fa fa-facebook" aria-hidden="true"></i> | |
</a> | |
<a class="btn btn-app"> | |
<i class="fa fa-twitter" aria-hidden="true"></i> | |
</a> | |
<a class="btn btn-app"> | |
<i class="fa fa-google-plus" aria-hidden="true"></i> | |
Google + | |
</a> | |
<a class="btn btn-app"> | |
<i class="fa fa-graduation-cap" aria-hidden="true"></i> | |
Escolaridade | |
</a> | |
</div> | |
<div > | |
<h3>Buscando dados no facebook -- other var {{o.lotus}}</h3> | |
<p ng-repeat="(key, value) in o.lotus"> | |
<!-- lotus {{key }} => value: {{ value }} --> | |
{{key}} | |
</p> | |
<hr> | |
<p ng-repeat="a in o.listFacebook"> | |
Name {{a}} | |
</p> | |
<hr> | |
<div class="progress"> | |
<div class="progress-bar progress-bar-striped progress-bar-primary active" role="progressbar" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"> | |
<span class="sr-only">60% Complete</span> | |
</div> | |
</div> | |
<ul class="timeline"> | |
<li> | |
<i class="fa fa-google-plus bg-purple"></i> | |
<div class="timeline-item"> | |
<h3 class="timeline-header">Resultados encontrados para {user.name}</h3> | |
<div class="timeline-body"> | |
<div class="row"> | |
<div class="col-sm-3 col-md-3"> | |
<div class="thumbnail"> | |
<img src="http://lorempixel.com/output/people-q-c-153-153-9.jpg" alt="" class="img-circle img-bordered-sm"> | |
<div class="caption"> | |
<h3> | |
<span class="username"> | |
<li ng-if="listFacebook.length != 26"> | |
imprime {{listFacebook}} <p ng-model="listFacebook.length"></p> | |
</li> | |
key{{ key }} | |
</span> | |
</h3> | |
<p> | |
<span class="description"> | |
<a > | |
{user.link} | |
</a> | |
</span> | |
</p> | |
<p> | |
<a href="#!/enrichiement/{{:: ctrl.customer.id}}/escolaridade" class="btn btn-primary" role="button">Selecionar</a> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</li> | |
<li> | |
</ul> | |
</div> | |
</div> | |
<!-- /.col --> | |
</div> | |
</div> | |
<!-- /.row --> | |
</section> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment