File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 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) {
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 } ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments