Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running template sample code in Angular 4.1.1 #28

Closed
mflorence99 opened this issue May 31, 2017 · 3 comments
Closed

Error running template sample code in Angular 4.1.1 #28

mflorence99 opened this issue May 31, 2017 · 3 comments

Comments

@mflorence99
Copy link

I feel like I'm doing something egregiously wrong and if so I apologize for posting an issue. ButnI can't figure the problem and any help would be great.

I have the PolymerModule imported into my app. I have this code in my main.ts:

platformBrowserDynamic().bootstrapModule(RootModule, {
  enableLegacyTemplate: false
});

I have this on a test page:

<iron-list [items]="['apple', 'pear']" as="item">
  <ng-template polymer>
    <div>XXX [[item]]</div>
  </ng-template>
</iron-list>

But I consistently get this error (plus a subsequent JavaScript exception) in my Chrome console:

iron-list requires a template to be provided in light-dom

If I had to guess, I'd say that despite all the setup Angular isn't aware of the polymer directive. Indeed, I got a hint from another issue that maybe that I should've coded polymer-template: but that didn't make any difference and may be a clue.

If I inspect the DOM, I see the following which seems to confirm that the polymer directive isn't taking effect:

<iron-list _ngcontent-c10="" as="item" style="overflow: auto;">
  <!---->
</iron-list>

I wish I'd known about Origami before -- it looks extremely useful -- if I can just get it to work!

@hotforfeature
Copy link
Owner

What version of iron-list and Origami do you have installed? Can you share your RootModule .ts file?

Alternatively if you have your project committed somewhere you can link it and I'll take a look.

@mflorence99
Copy link
Author

Of course! As I was preparing to describe where to find my RootModule.ts on GitHub I realized that the test code -- in a route -- is governed by a child module. I imported PolymerModule into it and of course it works perfectly. My apologies for being an idiot and thanks for your help. Great software!

@hotforfeature
Copy link
Owner

Glad to hear it! I'll go ahead and close this :)

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

No branches or pull requests

2 participants