I want to make a dotted line to fill in the blanks with the appropriate (draggable) word to complete the sentence.
string like:
The ______ brown ______ jumps over the ______ dog.
words like: fast , fox , lazy
but when I bind a string using ng-bind-html , jqyoui-droppable does not work in the returned string. Failed to reset the button (draggable key) in the space bar.
$scope.gapList = []; $scope.string = "The quick brown fox jumps over the lazy dog."; $scope.keys = ['quick','fox','lazy']; $scope.createDottedString = function () { for (var key in $scope.keys) { $scope.string = $scope.string.replace($scope.keys[key], '<em data-drop="true" data-jqyoui-options jqyoui-droppable ng-model="$scope.gapList" > ____________ </em>'); } return $sce.trustAsHtml($scope.string); };
html: <div ng-bind-html="createDottedString()"></div>
here is the plnkr link: demo
I used this jqyoui-droppable plugin to drag and drop with jqueryUI.
source share