Няма описание

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)
  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. $scope.abled = response.data.abled;
  17. }
  18. else
  19. {
  20. $window.location.href = '/'+user_type+'/error/'+response.data.tipo;
  21. console.log(response.data);
  22. }
  23. // $scope.selectedForm=
  24. // console.log(response.data);
  25. });
  26. });