Closed zoechi closed 7 years ago
When I remove the first line, the error goes away.
First line of what?
ORIGINAL EXCEPTION: type 'SpanElementImpl' is not a subtype of type 'Element' of 'value' where SpanElementImpl is from dart:html Element is from package:fhir_client_api/src/type/element.dart
It looks like somehow this package is shadowing the Element
from dart:html?
@leonsenft sorry
the first line from HTML (<span...
)
I added the other parts only after I wrote that text :-/
Would you be able to share the .template.dart file generated for the component (with the original spans)?
// @ignoreProblemForFile annotate_overrides
// @ignoreProblemForFile cancel_subscriptions
// @ignoreProblemForFile constant_identifier_names
// @ignoreProblemForFile non_constant_identifier_names
// @ignoreProblemForFile implementation_imports
// @ignoreProblemForFile library_prefixes
// @ignoreProblemForFile type_annotate_public_apis
// @ignoreProblemForFile STRONG_MODE_DOWN_CAST_COMPOSITE
// @ignoreProblemForFile UNUSED_IMPORT
// @ignoreProblemForFile UNUSED_SHOWN_NAME
// @ignoreProblemForFile UNUSED_LOCAL_VARIABLE
import 'hello_world_component.dart';
import 'package:angular2/src/core/reflection/reflection.dart' as _ngRef;
import 'package:fhir_client_api/fhir_client_api.dart';
import 'package:fhir_webui/fhir.dart';
import 'package:fhir_webui/webui.dart';
import 'package:angular2/angular2.template.dart' as i0;
import 'package:fhir_webui/fhir.template.dart' as i1;
import 'package:fhir_webui/webui.template.dart' as i2;
export 'hello_world_component.dart';
import 'hello_world_component.css.shim.dart' as import0;
import 'package:angular2/src/debug/debug_context.dart';
import 'package:angular2/src/debug/debug_app_view.dart';
import 'hello_world_component.dart' as import3;
import 'dart:html';
import 'package:angular2/src/core/render/api.dart';
import 'package:angular2/src/core/linker/app_view.dart';
import 'package:angular2/src/core/linker/view_type.dart' as import7;
import 'package:angular2/src/core/change_detection/change_detection.dart';
import 'package:angular2/src/core/linker/app_view_utils.dart' as import9;
import 'package:angular2/angular2.dart';
import 'package:fhir_webui/src/webui_generated/form/data_source.dart' as import11;
import 'package:fhir_webui/src/fhir/fhir_data_source.dart' as import12;
const List<dynamic> styles_HelloWorldComponent = const [import0.styles];
List<StaticNodeDebugInfo> nodeDebugInfos_HelloWorldComponent0 = [
null,null,null,null,null,null,null,null,null,null,null
]
;
class ViewHelloWorldComponent0 extends DebugAppView<import3.HelloWorldComponent> {
Element _el_0;
Element _el_3;
ButtonElement _el_6;
static RenderComponentType renderType;
ViewHelloWorldComponent0(AppView<dynamic> parentView,num parentIndex): super(import7.ViewType.COMPONENT,{},parentView,parentIndex,ChangeDetectionStrategy.CheckOnce,nodeDebugInfos_HelloWorldComponent0) {
rootEl = document.createElement('hello-world');
renderType ??= import9.appViewUtils.createRenderType('asset:dave_component/lib/hello_world/hello_world_component.html',ViewEncapsulation.Emulated,styles_HelloWorldComponent);
setupComponentType(renderType);
}
ComponentRef build() {
final import3.HelloWorldComponent _ctx = ctx;
final HtmlElement parentRenderNode = initViewRoot(rootEl);
var doc = document;
_el_0 = createAndAppendDbg(this,doc,'span',parentRenderNode,0,0,0);
_el_0.className = 'first';
addShimE(_el_0);
Text _text_1 = new Text('Hello');
_el_0.append(_text_1);
dbgElm(this,_text_1,1,0,20);
Text _text_2 = new Text(' ');
parentRenderNode.append(_text_2);
dbgElm(this,_text_2,2,0,32);
_el_3 = createAndAppendDbg(this,doc,'span',parentRenderNode,3,0,33);
_el_3.className = 'last';
addShimE(_el_3);
Text _text_4 = new Text('World');
_el_3.append(_text_4);
dbgElm(this,_text_4,4,0,52);
Text _text_5 = new Text('\n');
parentRenderNode.append(_text_5);
dbgElm(this,_text_5,5,0,64);
_el_6 = createAndAppendDbg(this,doc,'button',parentRenderNode,6,1,0);
addShimC(_el_6);
Text _text_7 = new Text('Search');
_el_6.append(_text_7);
dbgElm(this,_text_7,7,1,27);
Text _text_8 = new Text('\n\n');
parentRenderNode.append(_text_8);
dbgElm(this,_text_8,8,1,42);
Text _text_9 = new Text('\n');
parentRenderNode.append(_text_9);
dbgElm(this,_text_9,9,3,76);
Text _text_10 = new Text('\n');
parentRenderNode.append(_text_10);
dbgElm(this,_text_10,10,4,112);
_el_6.addEventListener('click',eventHandler0(ctx.search));
init(const [],const [],[
_el_0,_text_1,_text_2,_el_3,_text_4,_text_5,_el_6,_text_7,_text_8,_text_9,_text_10
]
);
return null;
}
}
AppView<import3.HelloWorldComponent> viewFactory_HelloWorldComponent0(AppView<dynamic> parentView,num parentIndex) {
return new ViewHelloWorldComponent0(parentView,parentIndex);
}
const List<dynamic> styles_HelloWorldComponentHost = const [];
List<StaticNodeDebugInfo> nodeDebugInfos_HelloWorldComponentHost0 = [new StaticNodeDebugInfo([import3.HelloWorldComponent],import3.HelloWorldComponent,<String, dynamic>{})];
class ViewHelloWorldComponentHost0 extends DebugAppView<dynamic> {
ViewHelloWorldComponent0 _compView_0;
import3.HelloWorldComponent _HelloWorldComponent_0_2;
static RenderComponentType renderType;
ViewHelloWorldComponentHost0(AppView<dynamic> parentView,num parentIndex): super(import7.ViewType.HOST,{},parentView,parentIndex,ChangeDetectionStrategy.CheckAlways,nodeDebugInfos_HelloWorldComponentHost0) {
renderType ??= import9.appViewUtils.createRenderType('',ViewEncapsulation.Emulated,styles_HelloWorldComponentHost);
setupComponentType(renderType);
}
ComponentRef build() {
final _ctx = ctx;
_compView_0 = new ViewHelloWorldComponent0(this,0);
rootEl = _compView_0.rootEl;
dbgIdx(rootEl,0);
_HelloWorldComponent_0_2 = new import3.HelloWorldComponent(this.injectorGet(import11.FormFhirDataSource,parentIndex),this.injectorGet(import12.FhirDataConnection,parentIndex));
_compView_0.create(_HelloWorldComponent_0_2,projectableNodes);
init([rootEl],const [],[rootEl]);
return new ComponentRef(0,this,rootEl,_HelloWorldComponent_0_2);
}
dynamic injectorGetInternal(dynamic token,int nodeIndex,dynamic notFoundResult) {
if ((identical(token, import3.HelloWorldComponent) && (0 == nodeIndex))) { return _HelloWorldComponent_0_2; }
return notFoundResult;
}
void detectChangesInternal() {
final _ctx = ctx;
_compView_0.detectChanges();
}
void destroyInternal() {
_compView_0.destroy();
}
}
AppView viewFactory_HelloWorldComponentHost0(AppView<dynamic> parentView,num parentIndex) {
return new ViewHelloWorldComponentHost0(parentView,parentIndex);
}
const ComponentFactory HelloWorldComponentNgFactory = const ComponentFactory('hello-world',viewFactory_HelloWorldComponentHost0,import3.HelloWorldComponent,_METADATA);
const _METADATA = const <dynamic>[HelloWorldComponent, const <dynamic>[]];
var _visited = false;
void initReflector() {
if (_visited) return; _visited = true;
_ngRef.reflector
..registerType(HelloWorldComponent, new _ngRef.ReflectionInfo(
const <dynamic>[HelloWorldComponentNgFactory],
const [const <dynamic>[FormFhirDataSource], const <dynamic>[FhirDataConnection]],
(FormFhirDataSource _dataSource, FhirDataConnection _dataConnection) => new HelloWorldComponent(_dataSource, _dataConnection))
)
;
i0.initReflector();
i1.initReflector();
i2.initReflector();
}
Sorry, one of the imports in your component shadows Element
from dart:html
. This is a known issue you can follow at #153. Until this is fixed, we recommend you prefix the problematic import in your component.
import 'package:fhir_client_api/src/type/element.dart' as fhir;
Uh right. I'm aware of the issue. It confused me that adding HTML with no Angular binding or directive caused it. Thanks for investigating.
Hi zoechi,
I am working on a Dart project and need to talk to a SMART-on-FHIR server.
Is this fhir_client_api.dart
library open source? I haven't been able to find a Dart FHIR client and will appreciate if you can point me in the right direction.
Thank you!
I have a component with the following template
The code of the component
when I launch the app in Dartium it causes
When I remove the first line, the error goes away.
In Chrome I get
Angular 3.1.0 Dart VM version: 1.25.0-dev.1.0 (Wed Jun 14 08:05:56 2017) on "macos_x64"