ng-readingtimeAngularJS 扩展指令
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'
});
}
}
}]);
评论
