Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/457.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用“;从jQuery插件更新AngularJS模型;在可见的”;回拨_Javascript_Jquery_Angularjs_Keyboard_Visible - Fatal编程技术网

Javascript 使用“;从jQuery插件更新AngularJS模型;在可见的”;回拨

Javascript 使用“;从jQuery插件更新AngularJS模型;在可见的”;回拨,javascript,jquery,angularjs,keyboard,visible,Javascript,Jquery,Angularjs,Keyboard,Visible,使用“on visible”回调从jQuery插件更新AngularJS模型 我想要在keybord可视函数中重现el.value .directive('keyboard', function () { return { restrict: 'C', link: function (scope, element, attr) { $(element).keyboard({ usePre

使用“on visible”回调从jQuery插件更新AngularJS模型

我想要在keybord可视函数中重现el.value

 .directive('keyboard', function () {
     return {

         restrict: 'C',
         link: function (scope, element, attr) {
             $(element).keyboard({
                 usePreview: false,
                 stickyShift: false,
                 autoAccept: true,
                 layout: 'custom',
                 display: {
                     'clear': 'vider :Clear',
                 },
                 customLayout: {
                     'default': [
                         'a z e r t y u i o p',
                         'q s d f g h j k l m',
                         'w x c v b n é è {del}',
                         '{clear} {space} {cancel} {b}'
                     ]
                 },
                 visible: function (e, keyboard, el) {
                     scope.newUser= el.value;
                 }
                 // ...
它起作用了

  change: function (e, keyboard, el) {
      scope.newUser= el.value;
  }

但是我想要可见的

可能是
范围。$apply(function(){scope.newUser=el.value;})
?我试过了,但它不起作用。如何在我的代码中实现这个解决方案