The duoshuo directive for angular
bower install angular-duoshuo
angular-duoshuo support all duoshuo data-*
option
- config the
shortName
for duoshuo. - add directive
<duoshuo data-thread-key="thread_key"></duoshuo>
, and replacethread_key
with your own thread_key.
var myApp = angular.module('myApp', ['meDuoshuo']);
myApp.config(['$duoshuoProvider', function($duoshuoProvider){
$duoshuoProvider.setShortName('short_name');
}]).controller('democontrol', ['$scope', function($scope){
$scope.test = 'new';
}]);
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>angular-duoshuo demo</title>
</head>
<body ng-app="myApp">
<div ng-controller="democontrol">
{{test}} should equal to <em>new</em>
<duoshuo data-thread-key="thread_key"></duoshuo>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script src="angular-duoshuo.js"></script>
<script src="demo.js"></script>
</body>
</html>
MIT