我正在尝试使用textAngular指令将值列表粘贴到文本区域并面对问题,我不能这样做。由于某种原因,它只显示括号而没有控制台中的任何错误。
我可以将数据粘贴到textAngular的唯一方法是提供路径,例如:
comparesing[0].description
直接在textAngular的ng-model中,但我需要显示值列表。那么有人能帮助我找到我的错误吗?提前谢谢。
这是我的代码:
angular.module("textAngularTest", ['textAngular'])
.controller('wysiwygeditor', ['$scope', 'textAngularManager', function wysiwygeditor($scope, textAngularManager) {
(function () {
$scope.data = '[{"id":11820,"occuredDate":"2016-10-26T18:23:01.000Z","title":"Log In","description":"User 123-001 logged in"},{"id":11819,"occuredDate":"2016-10-19T18:32:07.000Z","title":"Log out","description":"User has logged off"}]'
$scope.comparesing = JSON.parse($scope.data)
$scope.orightml = '<ol ng-repeat="(key, value) in comparesing"><li>{{value.description}}</li></ol>';
}());
}]);
HTML
<div text-angular name="Narrate items" ng-model="orightml"></div>
this is plunker我的错误