wyntau / angular-duoshuo

duoshuo directive for angular.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angular-duoshuo

The duoshuo directive for angular

Install

bower install angular-duoshuo

Status

angular-duoshuo support all duoshuo data-* option

Usage

  1. config the shortName for duoshuo.
  2. add directive <duoshuo data-thread-key="thread_key"></duoshuo>, and replace thread_key with your own thread_key.
demo.js
var myApp = angular.module('myApp', ['meDuoshuo']);

myApp.config(['$duoshuoProvider', function($duoshuoProvider){
    $duoshuoProvider.setShortName('short_name');
}]).controller('democontrol', ['$scope', function($scope){
    $scope.test = 'new';
}]);
index.html
<!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>

License

MIT

About

duoshuo directive for angular.js


Languages

Language:JavaScript 100.0%