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

前端 未结 8 817
自闭症患者
自闭症患者 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:32

    In your controller

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

    In your html

    {{ contentText | limitTo: 150 }}

提交回复
热议问题