I'm trying to do the following:
import 'dart:html';
import 'package:angular/angular.dart';
import 'package:markdown/markdown.dart' as md;
@Directive(selector: '[markdown]')
class MarkdownDirective {
@Input('markdown')
String marked;
MarkdownDirective(Element el) {
final html = md.markdownToHtml(marked);
print(el.innerHtml); // this is empty
print(html); // obv null
el.setInnerHtml(html);
}
}
I'm expecting innerHtml to have the value of the "markdown" content but it is null before it enters this directive.
<div markdown>{{report.summary}}</div>
I've tried this too and no luck:
<div [markdown]="'{{report.summary}}'" >{{report.summary}}</div>
Got interpolation ({{}}) where expression was expected at column 1 in ['{{report.summary}}']
- not understanding completely why it doesn't work./