Skip to content

Commit

Permalink
Issue with Kama.conf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypercubed committed Jan 21, 2014
1 parent fe45663 commit 5e32335
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions angular-marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@

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

app.constant('marked', marked);

// Maybe this is better?
//app.service('marked', ['$window', function($window) {
// return $window.marked;
//}]);
app.constant('marked', window.marked);

// TODO: filter tests */
//app.filter('marked', ['marked', function(marked) {
Expand All @@ -35,12 +30,17 @@
},
link: function (scope, element, attrs) {
var value = scope.marked || element.text() || '';
element.html(marked(value, scope.opts || null));
set();

if (attrs.marked)
function set() {
element.html(marked(value, scope.opts || null));
}

if (attrs.marked) {
scope.$watch('marked', function(value) {
element.html(marked(value || '', scope.opts || null));
});
});
}

}
};
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = function(config) {
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'angular-marked.js',
'bower_components/marked/lib/marked.js',
'angular-marked.js',
'test/spec/**/*.js'
],

Expand Down

0 comments on commit 5e32335

Please sign in to comment.