Skip to content

Commit 5e32335

Browse files
committed
Issue with Kama.conf.js
1 parent fe45663 commit 5e32335

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

angular-marked.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@
1313

1414
var app = angular.module('hc.marked', []);
1515

16-
app.constant('marked', marked);
17-
18-
// Maybe this is better?
19-
//app.service('marked', ['$window', function($window) {
20-
// return $window.marked;
21-
//}]);
16+
app.constant('marked', window.marked);
2217

2318
// TODO: filter tests */
2419
//app.filter('marked', ['marked', function(marked) {
@@ -35,12 +30,17 @@
3530
},
3631
link: function (scope, element, attrs) {
3732
var value = scope.marked || element.text() || '';
38-
element.html(marked(value, scope.opts || null));
33+
set();
3934

40-
if (attrs.marked)
35+
function set() {
36+
element.html(marked(value, scope.opts || null));
37+
}
38+
39+
if (attrs.marked) {
4140
scope.$watch('marked', function(value) {
4241
element.html(marked(value || '', scope.opts || null));
43-
});
42+
});
43+
}
4444

4545
}
4646
};

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = function(config) {
1515
files: [
1616
'bower_components/angular/angular.js',
1717
'bower_components/angular-mocks/angular-mocks.js',
18-
'angular-marked.js',
1918
'bower_components/marked/lib/marked.js',
19+
'angular-marked.js',
2020
'test/spec/**/*.js'
2121
],
2222

0 commit comments

Comments
 (0)