Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Import additional compiler code with a prefix #153

Closed
olostan opened this issue Oct 25, 2016 · 6 comments
Closed

Import additional compiler code with a prefix #153

olostan opened this issue Oct 25, 2016 · 6 comments

Comments

@olostan
Copy link

olostan commented Oct 25, 2016

If in the dart file where Angular 2 Dart component is, define (declare, import etc) document symbol, Angular 2 application falls (as it try to use this symbol from compiled templates.

Example of app_component.dart from angular 2 stagehand project that stop app from working:

import 'package:angular2/core.dart';

document() {
}

@Component(
    selector: 'symbol',
    template:'<div [id]="name"><ng-content></ng-content></div>'
)
class SymbolComponent {
  @Input('name') String name;
}

@Component(
    selector: 'my-app',
    styleUrls: const ['app_component.css'],
    directives: const [SymbolComponent],
    templateUrl: 'app_component.html')
class AppComponent {}

gives:

ORIGINAL EXCEPTION: NoSuchMethodError: Closure call with mismatched arguments: function 'createElement'
Receiver: Closure: () => dynamic from Function 'document': static.
Tried calling: createElement("div")
Found: createElement()
@olostan olostan changed the title Having document symbol defined in control brake template compilation Having document symbol defined brake template compilation Oct 25, 2016
@matanlurey
Copy link
Contributor

Blocked by #48

(We don't know where things are imported, yet)

@matanlurey matanlurey added this to the Type-aware compiler milestone Dec 26, 2016
@matanlurey matanlurey removed this from the Type-aware compiler milestone Jan 20, 2017
@matanlurey matanlurey added this to the V4 Beta milestone Apr 4, 2017
@matanlurey
Copy link
Contributor

This is now planned for the 4.0 release.

@matanlurey
Copy link
Contributor

This is unlikely to be in the 4.0 release. Some of the groundwork will be, though.

@matanlurey matanlurey modified the milestones: Post-V4, V4 Beta May 12, 2017
@matanlurey matanlurey changed the title Having document symbol defined brake template compilation Don't collide user-land code with runtime-imports that are generated May 12, 2017
@olostan
Copy link
Author

olostan commented May 19, 2017

Is it possible to list somewhere in documentation list of "forbidden words"? Would be useful

@matanlurey
Copy link
Contributor

Upate: We've agreed to prefix dart:html for 4.0.0.

@matanlurey matanlurey modified the milestones: V4 Alpha, Post-V4 Jul 17, 2017
@matanlurey
Copy link
Contributor

This made it into 4.0.0-alpha+1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants