title: Ionic- not getting data of form on click of header button
body: <p>This is my code : </p>
  
  <pre><code>&lt;ion-view view-title="Register"&gt;
      &lt;ion-nav-buttons side="right"&gt;
          &lt;button class="button button-icon button-clear ion-android-done" ng-click="createCompanyUser(signup)" ng-hide="signupForm.signupMobile.$error.maxlength || signupForm.signupMobile.$error.minlength || signupForm.signupFirstName.$error.required || signupForm.signupLastName.$error.required || signupForm.signupEmail.$error.required || signupForm.signupEmail.$error.email || signupForm.signupPwd.$error.required || signupForm.signupMobile.$error.required || signupForm.confirmpwd.$error.required"&gt;
          &lt;/button&gt;
      &lt;/ion-nav-buttons&gt;
      &lt;ion-content class="" has-header&gt;
          &lt;form name="signupForm" novalidate&gt;
              &lt;ion-item class="item item-thumbnail-left"&gt;
                  &lt;img id="signupImage" src="" style="padding: 2px;border: 1px solid; height: 100px;width: 100px;"&gt;
                  &lt;h2&gt;Select Company Logo&lt;/h2&gt;
                  &lt;br&gt;
                  &lt;input type="file" id="i_fileSignup" value="" accept="image/*"&gt;                
              &lt;/ion-item&gt;
              &lt;div class="list list-inset"&gt;
  
                  &lt;label class="item item-input item-floating-label"&gt;
                      &lt;span class="input-label"&gt;First Name&lt;/span&gt;
                      &lt;input type="text" placeholder="First Name" name="signupFirstName" ng-model="signup.signupFirstName" required&gt;
                  &lt;/label&gt;
                  &lt;span style="color:red" ng-show="signupForm.signupFirstName.$dirty"&gt;
                      &lt;span ng-show="signupForm.signupFirstName.$error.required"&gt;First name field is required.&lt;/span&gt;
                  &lt;/span&gt; 
  
                  &lt;label class="item item-input item-floating-label"&gt;
                      &lt;span class="input-label"&gt;Last Name&lt;/span&gt;
                      &lt;input type="text" placeholder="Last Name" name="signupLastName" ng-model="signup.signupLastName" required&gt;
                  &lt;/label&gt;
                  &lt;span style="color:red" ng-show="signupForm.signupLastName.$dirty"&gt;
                      &lt;span ng-show="signupForm.signupLastName.$error.required"&gt;Last name field is required.&lt;/span&gt;
                  &lt;/span&gt; 
  
                  &lt;label class="item item-input item-floating-label"&gt;
                      &lt;span class="input-label"&gt;Email&lt;/span&gt;
                      &lt;input type="email" placeholder="Email" name="signupEmail" ng-model="signup.signupEmail" required&gt;
                  &lt;/label&gt;
                  &lt;span style="color:red" ng-show="signupForm.signupEmail.$dirty &amp;&amp; signupForm.signupEmail.$invalid"&gt;
                      &lt;span ng-show="signupForm.signupEmail.$error.required"&gt;Email is required.&lt;/span&gt;
                      &lt;span ng-show="signupForm.signupEmail.$error.email"&gt;Invalid email address.&lt;/span&gt;
                  &lt;/span&gt;
  
                  &lt;label class="item item-input item-floating-label"&gt;
                      &lt;span class="input-label"&gt;Mobile&lt;/span&gt;
                      &lt;input type="tel" placeholder="Mobile" name="signupMobile" id="mobile" ng-keypress="fnMobile()" ng-minlength="10" ng-maxlength="10" ng-model="signup.signupMobile" required&gt;
                  &lt;/label&gt;
                  &lt;span style="color:red" ng-show="signupForm.signupMobile.$dirty"&gt;
                      &lt;span ng-show="signupForm.signupMobile.$error.required"&gt;Mobile field is required.&lt;/span&gt;
                      &lt;span ng-show="signupForm.signupMobile.$error.minlength"&gt;Mobile number should be at least 10 digit.&lt;/span&gt;
                      &lt;span ng-show="signupForm.signupMobile.$error.maxlength"&gt;Mobile number can not be at more than 10 digit.&lt;/span&gt;
                  &lt;/span&gt; 
  
                  &lt;label class="item item-input item-floating-label"&gt;
                      &lt;span class="input-label"&gt;Password&lt;/span&gt;
                      &lt;input type="password" placeholder="Password" name="signupPwd" ng-model="signup.signupPwd" required&gt;
                  &lt;/label&gt;
                  &lt;span style="color:red" ng-show="signupForm.signupPwd.$dirty"&gt;
                      &lt;span ng-show="signupForm.signupPwd.$error.required"&gt;Password field is required.&lt;/span&gt;
                  &lt;/span&gt;
  
                  &lt;label class="item item-input item-floating-label"&gt;
                      &lt;span class="input-label"&gt;Confirm Password&lt;/span&gt;
                      &lt;input type="password" placeholder="Confirm Password" name="confirmpwd" ng-model="signup.confirmpwd" ng-match="signupPwd" required&gt;
                  &lt;/label&gt;   
                  &lt;span style="color:red" ng-show="signupForm.confirmpwd.$dirty"&gt;
                      &lt;span ng-show="signupForm.confirmpwd.$error.match"&gt;Emails have to match!&lt;/span&gt;
                      &lt;span ng-show="signupForm.confirmpwd.$error.required"&gt;Confirm Password is required.&lt;/span&gt;
                  &lt;/span&gt;
  
                  &lt;a class="button button-clear button-positive" href="#/app/login"&gt;I am already registered.&lt;/a&gt;
                  &lt;br&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/ion-content&gt;
  &lt;/ion-view&gt;
  </code></pre>
  
  <p><strong>js code :</strong></p>
  
  <pre><code>angular.module('serviceprovider.signup', [])
  
          .controller('signupCtrl', function ($scope, $location, $http) {
  
              $scope.createCompanyUser = function (val)
              {
                  alert(JSON.stringify(val));
              };
  
          });
  </code></pre>
  
  <p><strong>menu.html:</strong></p>
  
  <pre><code>&lt;ion-side-menus enable-menu-with-back-views="true" ng-click="fnMenu()"&gt;
      &lt;ion-side-menu-content drag-content="false"&gt;
          &lt;ion-nav-bar class="bar-stable bar-royal"&gt;
              &lt;ion-nav-back-button class="button-icon ion-arrow-left-c"&gt;
              &lt;/ion-nav-back-button&gt;
  
              &lt;ion-nav-buttons side="right"&gt;
                  &lt;button class="button button-icon button-clear ion-navicon" ng-click="toggleRight()"&gt;
                  &lt;/button&gt;
              &lt;/ion-nav-buttons&gt;
          &lt;/ion-nav-bar&gt;
          &lt;ion-nav-view name="menuContent"&gt;&lt;/ion-nav-view&gt;
      &lt;/ion-side-menu-content&gt;
  
      &lt;ion-side-menu side="right"&gt;
          &lt;ion-content&gt;
              &lt;ion-list&gt;
  
                  &lt;div class="mymenu"&gt;
  
                      &lt;ion-item menu-close href="#/app/userDashboard"&gt;
                          &lt;i class="fa fa-tachometer"&gt;&lt;/i&gt; Dashboard
                      &lt;/ion-item&gt;
                      &lt;ion-item menu-close href="#/app/userMyProfile"&gt;
                          &lt;i class="fa fa-user"&gt;&lt;/i&gt; My Profile
                      &lt;/ion-item&gt;
                      &lt;ion-item menu-close href="#/app/changePwd"&gt;
                          &lt;i class="fa fa-key"&gt;&lt;/i&gt; Change Password
                      &lt;/ion-item&gt;
                      &lt;ion-item menu-close href="#/app/listProduct/0"&gt;
                          &lt;i class="fa fa-tags"&gt;&lt;/i&gt; Products
                      &lt;/ion-item&gt;
                      &lt;ion-item menu-close href="#/app/listCart"&gt;
                          &lt;i class="fa fa-shopping-cart"&gt;&lt;/i&gt; Cart
                      &lt;/ion-item&gt;
                      &lt;ion-item menu-close href="#/app/listQuotation" ng-show="userquotation"&gt;
                          &lt;i class="fa fa-file-text-o"&gt;&lt;/i&gt; Quotation
                      &lt;/ion-item&gt;
                      &lt;ion-item menu-close href="#/app/listOrder" ng-show="userorder"&gt;
                          &lt;i class="fa fa-clipboard"&gt;&lt;/i&gt; Order
                      &lt;/ion-item&gt;
                  &lt;/div&gt;
  
                  &lt;div class="config"&gt;
                      &lt;ion-item menu-close ng-click="signout()"&gt;
                          &lt;i class="fa fa-sign-out"&gt;&lt;/i&gt; Sign out
                      &lt;/ion-item&gt;
                  &lt;/div&gt;
              &lt;/ion-list&gt;
          &lt;/ion-content&gt;
      &lt;/ion-side-menu&gt;
  &lt;/ion-side-menus&gt;
  </code></pre>
  
  <p>I want to get form data on click of <code>createCompanyUser(signup)</code> function. but i get undefined value.
  Please help me.
  Thanks.</p>