Good day everyone.
Im trying to write application which send request to the server and prints 
answer.
The form has Submit batton, which calls retreive() function. 
But what should I do to submit page after loading with default values?
Thank you very much.

<form name="dateForm" ng-submit="submit()" ng-controller="TS" onload="sss()"
>
<div class="check-element animate-hide" ng-show="widesearchfl">
            <tt> {{widesearchtxt}} </tt></br>
        </div>
        <tt>
            Enter place: <input type="text" name="place" ng-model="place" 
ng-trim="false">
        </tt></br>
        <tt>
            Pick a date in:
                <input type="date" id="checkin_id" name="checkin" ng-model=
"valuein" placeholder="yyyy-MM-dd" min="2013-01-01" max="2030-12-31" 
required />
                    <span class="error" ng-show=
"dateForm.checkin.$error.required">Required!</span>
                    <span class="error" ng-show=
"dateForm.checkin.$error.date">Not a valid date!</span>
        </tt></br>
        <tt>
            Pick a date out:
                <input type="date" id="checkout" name="checkout" ng-model=
"valueout" placeholder="yyyy-MM-dd" min="2013-01-01" max="2030-12-31" 
required />
                    <span class="error" ng-show=
"dateForm.checkout.$error.required">Required!</span>
                    <span class="error" ng-show=
"dateForm.checkout.$error.date">Not a valid date!</span>
        </tt></br>
        <p>
             ....
        <p>
        <input type="submit" id="submit" value="Submit" />


 
 .controller('TS, ['$scope', '$http', function($scope, $http) {
    $scope.name = "user";
    $scope.team = [];
    $scope.widesearchfl = false;
    $scope.valuein = new Date(2013, 7, 22);
    $scope.valueout = new Date(2014, 7, 22);
    $scope.Accepted = true;
    $scope.price  = 500;

    $scope.retrieve = function(){
        .....
     };

    $scope.sss = function() {
        console.log("ddd");
        $scope.submit();
      };
    $scope.submit = function() {
        $scope.retrieve();
      };



-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to