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

3.1.0+ w/ use_analyzer: Can't use external packages. #390

Closed
jodinathan opened this issue May 16, 2017 · 5 comments
Closed

3.1.0+ w/ use_analyzer: Can't use external packages. #390

jodinathan opened this issue May 16, 2017 · 5 comments
Milestone

Comments

@jodinathan
Copy link

Hi,

I imported NgModel:
import 'package:angular2/angular2.dart' show NgModel;

added it to the directives:
@component(directives: const [NgModel])

However, the error still occurs:
ParseErrorLevel.FATAL: Can't bind to 'ngModel' since it isn't a known native property or known directive. Please fix typo or add to directives list.

This does not happen with NgClass and NgIf.

@matanlurey
Copy link
Contributor

Could you include your entire .dart, .html, and pubspec.yaml, if possible?

You can email me at matanl@google.com if it is private and you'd prefer not to post publicly.

@matanlurey
Copy link
Contributor

In the example you emailed me there is no NgModel in your address_generic.dart file.

Everyplace you use ngModel in your .html template you must declare it in directives: [ ... ] in the corresponding .dart file. Please re-open this issue if you feel that there is something else going on.

@matanlurey matanlurey reopened this May 16, 2017
@matanlurey matanlurey added this to the V4 Beta milestone May 16, 2017
@matanlurey matanlurey changed the title 3.1.0-beta is not binding ngModel 3.1.0-beta w/ use_analyzer: Can't use external packages. May 16, 2017
@matanlurey
Copy link
Contributor

matanlurey commented May 16, 2017

Re-opened, as discussed on Gitter.

Using is trying to use package:intl and package:http, both of which are not AngularDart libraries, but we still try and import http.template.dart and intl.template.dart. I believe @alorenzen has a fix for this internally (yet to submit).

Workaround is not to use use_analyzer: true, yet.

@zoechi
Copy link

zoechi commented May 19, 2017

Seems to be the same issue dart-lang/pub#1611

@matanlurey matanlurey changed the title 3.1.0-beta w/ use_analyzer: Can't use external packages. 3.1.0+ w/ use_analyzer: Can't use external packages. May 22, 2017
@natebosch
Copy link
Contributor

Does our multi-phase approach solve this? I'm a bit surprised to see it's a problem at all...

cc @jakemac53
If this multi-phase approach fixes this we might need to unblock this in build_runner.

matanlurey pushed a commit that referenced this issue Jun 5, 2017
Add TemplatePlaceholderBuilder which only creates a `.ng_placeholder`
Replace the collection of input assets in a global variable with a check for
the placeholder file.

This also removes the last usages of the old "transformer" internally, so we no longer generate .ng_meta.json and .ng_summary.json, both reducing the number of files per target by 1 and also improving the speed of compiles.

Closes #390.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158060754
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants