Access scope of form input fields

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



html code

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


. controller(‘login_pg’, function($scope,$location){

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


looks like you typed something wrong…


should be


yes this is the correct syntax for your scope…