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

cannot read property of settings of undefined #205

Closed
superstarmcawesome opened this issue Jul 3, 2016 · 1 comment
Closed

cannot read property of settings of undefined #205

superstarmcawesome opened this issue Jul 3, 2016 · 1 comment

Comments

@superstarmcawesome
Copy link

superstarmcawesome commented Jul 3, 2016

hello there,
the best datepicker I've seen so far for angular 2 projects! thats why I really wanna use it ... butttt I have some integration errors..
I'm using the mgechev/angular2-seed project...
I installed the @vaadin/angular2-polymer and webcomponentsjs via npm...
loading them in the seed.config..
and added the bower packages...

as soon as I hit npm start.. everything compiles fine.. but I have an error in my console and i cannot figure out where it comes from

102 Error: TypeError: Cannot read property 'Settings' of undefined(…) "Report this error at https://github.com/mgechev/angular2-seed/issues"

I added a plunker with my component and the seed&config files...
https://plnkr.co/edit/qsjIAqZ146nrsaeqoIzs?p=catalogue

thats actually my first bower package.. so I'm not sure what exactly I'm missing out here

any ideas on this one?

@platosha
Copy link
Contributor

platosha commented Jul 4, 2016

Hello, the cause is that Polymer was not imported.

Just installing bower packages is not enough. You should also:

  1. Import the Polymer elements you need, such as Vaadin Date Picker, by adding the HTML imports,
  2. Make sure that the Angular 2 application code is imported after the HTML imports are loaded and the Polymer elements are registered.

Importing Polymer elements with HTML imports will also import their dependencies, including the Polymer library itself. This will resolve the error you have.

Please see the Step 4 of the Angular 2 with Polymer Elements Tutorial for the detailed instructions. These tutorial instructions are based on the Angular 2 QuickStart application code. We don’t have the instructions targeted for mgechev/angular2-seed-based projects. In our tutorial, we place HTML imports in the head section of the index.html file, and we postpone the System.import('app') call by wrapping it into an event listener for the WebComponentsReady event. These implementation details might be different for your project base, though the requirements behind them are the same.

Apart from that, the error message you have is indeed not descriptive and unhelpful. This is an issue of the @vaadin/angular2-polymer package rather than of the Date Picker element. Filed there: platosha/angular-polymer#42

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