ng-readingtimeAngularJS 扩展指令

联合创作 · 2023-09-19 13:11

ng-readingtime 是 AngularJS 的指令,可以用来获取对指定文本的阅读时间。

使用示例

<p>
  Reading time: <span ng-reading-time text-to-read="text"></span>
</p>
.directive('myCustomDirective', ['readingTime', function(readingTime) {  return {    // ... skipped code
    link: function() {
      scope.result = readingTime.get(text, {
        wordsPerMinute: 210,
        format: 'text_only'
      });
    }
  }
}]);

 

浏览 2
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报