i'm working on a page that should have an input field and an onscreen keyboard, implemented in js. I used this keyboard: http://jabtunes.com/notation/keyboardcanvasexamples.html
The input field gets the input just fine, the problem is that the angular filters depending on this input field don't work. There is a similar problem i found described in this plunker with no solution: http://plnkr.co/edit/FnrZTAwisYub5Vukaw2l?p=preview
html:
<html ng-app="plunker">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.6.0.js"></script>
<script src="example.js"></script>
<script src="jKeyboard.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class='container-fluid' ng-controller="TypeaheadCtrl">
<pre>Model: {{selected| json}}</pre>
<input type="text" ng-model="selected" id="testInput" typeahead="state.name for state in states | filter:$viewValue | limitTo:8">
</div>
<button id="btn">E</button>
</body>
</html>
js:
angular.module('plunker', ['ui.bootstrap']);
function TypeaheadCtrl($scope) {
$scope.selected = undefined;
$scope.WatchPrintList = function () {
$scope.selected= {};
$scope.$watch('#testInput', function(newVal, oldVal) {
$scope.selected = newVal;
}, true);
}
$scope.states = [
{"name":"Alabama","alpha-2":"AL"},
{"name":"Alaska","alpha-2":"AK"},
//etc etc
];
}
When typing with the onscreen keyboard, no filters respond, but typing with the real keyboard they get updated and the data is filtered accordingly. Why?
Thx for your help!