Skip to content

Instantly share code, notes, and snippets.

@asmodehn
Created September 13, 2015 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asmodehn/4bb9dd70809e87cb3fcf to your computer and use it in GitHub Desktop.
Save asmodehn/4bb9dd70809e87cb3fcf to your computer and use it in GitHub Desktop.
gaaVLL
<html ng-app="app">
<body>
<div ng-controller="Test">
<p>selected item is : {{selectedItem}}</p>
<p> age of selected item is : {{selectedItem.age}} </p>
<select jqm-select ng-model="selectedItem" ng-options="item.name for item in items">
</select>
</div>
</body>
</html>
var app = angular.module('app', []);
app.controller('Test', function($scope, $timeout) {
$scope.items = [{
name: 'one',
age: 30
}, {
name: 'two',
age: 27
}];
$timeout(function first() {
$scope.items = [{
name: 'one',
age: 30
}, {
name: 'two',
age: 27
}, {
name: 'three',
age: 50
}, {
name: 'four',
age: 70
}];
$scope.selectedItem = $scope.items[3];
$timeout(function() {
$scope.items = [{
name: 'one',
age: 30
}, {
name: 'two',
age: 27
}, {
name: 'three',
age: 50
}];
$scope.selectedItem = $scope.items[2];
$timeout(first(), 5000);
}, 5000);
}, 5000);
});
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<link href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" rel="stylesheet" />
@asmodehn
Copy link
Author

Bug with select menu selection from model, not unselecting previous option ( still in span )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment