Skip to content

Instantly share code, notes, and snippets.

@fellipeh
Created December 10, 2015 12:21
Show Gist options
  • Save fellipeh/a107e9e254d9b52306fb to your computer and use it in GitHub Desktop.
Save fellipeh/a107e9e254d9b52306fb to your computer and use it in GitHub Desktop.
MyAppMobile.angular.controller('FiltroPageController', ['$scope', '$http', '$window', 'InitService',
'ParametrosService', 'FiltroService',
function ($scope, $http, $window, InitService, ParametrosService, FiltroService) {
'use strict';
$scope.parametros = ParametrosService.parametros;
$scope.Titulo = $scope.parametros.nome;
$scope.onItemClicked = function (produto) {
FiltroService.produtoClicked(produto);
};
InitService.addEventListener('ready', function () {
console.log('Carregando os detalhes...');
$scope.detalhes_loaded = false;
FiltroService.getDestaques($scope.parametros.valor).then(function (result) {
console.log(result);
$scope.detalhes = result.data;
$scope.detalhes_loaded = true;
}, function (err) {
console.error(err);
});
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment