Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template: '<span class="cite-text" [citable]="citableForCitation()">{{citationText}}</span>',
- Attribute [citable] in not allowed here
- template: '<span class="cite-text">{{citationText}}</span>',
- <citation bentry=1>[Lin92]</citation>
- library citation_component;
- import 'dart:html';
- import 'package:angular/angular.dart';
- import 'package:angular_forms/angular_forms.dart';
- import 'package:citable/citable/citable.dart' show CitableModel;
- @Component(
- selector: 'citation',
- template: '<span class="cite-text" [citable]="citableForCitation()">{{citationText}}</span>',
- styleUrls: const ['citation.css'],
- directives: const [formDirectives, 'citableForCitation'])
- class CitationComponent
- {
- @Input() int bentry;
- //@NgAttr('bentry')
- //int bentry;
- // Set up the decorator
- static final citable = new Expando<CitableModel>();
- final Element element;
- String citationText;
- CitationComponent(this.element)
- {
- citationText = element.innerHtml;
- }
- CitableModel citableForCitation()
- {
- if (citable[this] == null)
- {
- citable[this] = new CitableModel(bentry);
- }
- return citable[this];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement