change value in the current input (angularjs)



  • I have a form that goes to the google table, it has become necessary to send the address of the page with which the form is sent (station dynamic).

    <form action="https://docs.google.com/forms/d/1ovpSrmwaE8ednjqmVo4PxHZXHlCfbqdRvp355H8IS8Q/formResponse" method="POST" id="ss-form" target="hidden_iframe" ng-submit="dissmisMtest()">
    <input type="text" name="entry.1347629290" ng-value="urlina()" class="InputToGform" dir="auto" placeholder="ссылка" title="">
    <button type="submit" name="submit" value="&#1043;&#1086;&#1090;&#1086;&#1074;&#1086;" id="ss-submit" class="SendFormToGDocs myBtn">Отправить</button>
    </form>
    

    In the controller, the urlina(s) function is:

    $scope.urlina = function () {
    var a = "http://velesmebel.by/#" + $location.$$url;
    console.log("location",a);
    return a;
    }
    

    The value does not change, however, and does not remove the address to help the starting Javascripter =



  • ♪ good use ng-model

    The problem is, you're probably not declaring the $location argument when you call a controller or a url empty.

    Use the $location.absUrl. - You'll get a full reference. Or check that $location.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2