Нет описания

12345678910111213141516171819202122232425262728293031
  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. $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. });