Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

Get value from dropdown

$
0
0

@Ckpk wrote:

Trying to get the value from the dropdown, but when i click button, instead its getting the value, it give an array

Object {id: "1", game: "SEAL ONLINE", $$hashKey: "object:4"}

I just want to get the id which is 1

Here is my code.

addlist.html

    <select ng-model="addlist.games" ng-options="x.game for x in data">
      <option value="{{x.id}}">{{x.game}}</option>
    </select>

controller.js

.controller('AddListGamesCtrl', function($scope, $http, $ionicPopup, $state) {

  $scope.addlist = {};
  $scope.AddListSave = function() {
      console.log($scope.addlist.games);
  };
})

Posts: 4

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles