Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49167

Access scope of form input fields

$
0
0

@samxfido88 wrote:

how can i access the scope of username and password as shown below in ionic . when i use this code im getting

screenshot

error

html code

<ion-view view-title="Login"  hide-nav-bar="true">
  <ion-content>
   <div class="list list-inset">
          <label class="item item-input">
              <input type="text" placeholder="Username" ng-model="data.username">
          </label>
          <label class="item item-input">
              <input type="password" placeholder="Password" ng-model="data.password">
          </label>
      </div>
      <button class="button button-block button-calm" ng-click="login()">Login</button>
  </ion-content>
</ion-view>

controller.js

. controller('login_pg', function($scope,$location){
$scope.logindata={}

    $scope.login = function() {
    console.log("LOGIN user: " + $scope.data.username + " - PW: " + $scope.data.password);
}


})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>