Skip to content

Commit 77d4ef6

Browse files
committed
0.1: remove directive
1 parent 0d9b47d commit 77d4ef6

2 files changed

Lines changed: 3 additions & 31 deletions

File tree

examples/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
<div id="angular-duoshuo" class="angular-duoshuo" ng-controller="duoshuo">
2222
<h3 ng-show="responseJSON">当前用户数据:</h3>
2323
<div class="response" ng-bind="responseJSON"></div>
24-
<div duoshuo thread-key="123"></div>
2524
</div>
2625
<script>
2726
var duoshuoQuery = {
28-
short_name: '111'
27+
short_name: 'candy'
2928
}
3029
</script>
3130
<script src="http://static.duoshuo.com/embed.unstable.js"></script>

src/duoshuo.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
;
2-
(function(angular, duoshuo, API, configs) {
1+
;(function(angular, duoshuo, API, configs) {
32

43
'use strict';
54

@@ -12,33 +11,7 @@
1211
angular.module('duoshuo', [])
1312
.factory('$duoshuo', function() {
1413
return new Duoshuo(configs);
15-
})
16-
.directive('duoshuo', ['$duoshuo',
17-
function($duoshuo) {
18-
return {
19-
restrict: 'EA',
20-
replace: true,
21-
scope: {
22-
threadKey: '=',
23-
title: '=',
24-
image: '=',
25-
url: '=',
26-
authorKey: '=',
27-
formPosition: '=',
28-
limit: '=',
29-
order: '='
30-
},
31-
template: '<div class="ds-thread"></div>',
32-
link: function(scope, element, attrs) {
33-
scope.$watch('threadKey', function(threadKey) {
34-
if (angular.isDefined(threadKey)) {
35-
// $duoshuo.loadComment(scope, element[0]);
36-
}
37-
});
38-
}
39-
};
40-
}
41-
]);
14+
});
4215

4316
function Duoshuo() {
4417
this.configs = configs;

0 commit comments

Comments
 (0)