No Description

forma.js 826B

123456789101112131415161718192021222324252627282930
  1. var forma = angular.module('forma', ['ngSanitize']);
  2. // Define the `PhoneListController` controller on the `phonecatApp` module
  3. forma.controller('FormController', function FormController($http, $scope, accion, tipo, id, user_type, $window) {
  4. console.log(accion +","+ tipo +","+ id);
  5. var url = '/'+user_type+'/formaDatos/'+accion+'/'+tipo+'/'
  6. if(id!="none")
  7. {
  8. url+= id;
  9. }
  10. $http.get(url).then(function(response) {
  11. if(response.data.error!==true)
  12. {
  13. $scope.entradas = response.data.entradas;
  14. $scope.titulo = response.data.titulo;
  15. $scope.accion = response.data.accion;
  16. }
  17. else
  18. {
  19. $window.location.href = '/'+user_type+'/error/'+response.data.tipo;
  20. console.log(response.data);
  21. }
  22. // $scope.selectedForm=
  23. // console.log(response.data);
  24. });
  25. });