Simple way to limit characters in ng-bind-html Angular JS

前端 未结 8 724
自闭症患者
自闭症患者 2021-01-13 02:15

I am trying to limit the characters i see on my angular js app. Currently i am using:

8条回答
  •  清酒与你
    2021-01-13 02:35

    Inject $sce into your controller and then use it like below:

    $scope.contentText = $sce.trustAsHtml(item.get('Content')); 
    

    In your html

提交回复
热议问题