2

アプリで ng-tag-input と ui-block を一緒に使用しています。オートコンプリート ng-tag-input を使用しています。入力タグに 3 文字入力すると、タグ候補が表示されません。

エラーが発生します:

Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.2.22/$rootScope/inprog?p0=NaNigest
    at VALIDITY_STATE_PROPERTY (http://localhost:9000/bower_components/angular/angular.js:78:12)
    at beginPhase (http://localhost:9000/bower_components/angular/angular.js:12966:15)
    at Scope.$get.Scope.$apply (http://localhost:9000/bower_components/angular/angular.js:12755:11)
    at HTMLInputElement.<anonymous> (http://localhost:9000/bower_components/ng-tags-input/ng-tags-input.min.js:1:4856)
    at HTMLInputElement.jQuery.event.dispatch (http://localhost:9000/bower_components/jquery/dist/jquery.js:4641:9)
    at HTMLInputElement.jQuery.event.add.elemData.handle (http://localhost:9000/bower_components/jquery/dist/jquery.js:4309:46)
    at BlockUI.blkUI.factory.reset (http://localhost:9000/bower_components/angular-block-ui/dist/angular-block-ui.js:329:28)
    at BlockUI.blkUI.factory.stop (http://localhost:9000/bower_components/angular-block-ui/dist/angular-block-ui.js:301:14)
    at Object.blkUI.factory.utils.forEachFn (http://localhost:9000/bower_components/angular-block-ui/dist/angular-block-ui.js:453:19)
    at Array.blkUI.factory.utils.forEachFnHook.arr.(anonymous function) [as stop] (http://localhost:9000/bower_components/angular-block-ui/dist/angular-block-ui.js:458:15) 

しかし、ui-block を削除すると、app.ng-tag-input正常に動作します。

コントローラー:

var app = angular.module('plunker', ['ngTagsInput','blockUI']);

app.controller('MainCtrl', function($scope, $http) {
  $scope.tags = [
    { text: 'Tag1' },
    { text: 'Tag2' },
    { text: 'Tag3' }
  ];

  $scope.loadTags = function(query) {
    return $http.get('tags.json');
  };
});

HTML:

<body ng-controller="MainCtrl">
    <tags-input ng-model="tags">
      <auto-complete source="loadTags($query)"></auto-complete>
    </tags-input>
    <p>Model: {{tags}}</p>
  </body>

ui-block は ng-tag-input と互換性がないと思います。この問題を解決する方法を教えてください。プランカーを見る

4

2 に答える 2