Invalid Method of Declaring PolymerElement in Angular 2

I am trying to include a vaadin-grid in an Angular 2 application. Following your tutorial example I tried to declare PolymerElement(‘vaadin-grid’) in app.module.ts as follows:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { PeopleService } from './services/people.service';
import { PolymerElement } from '@vaadin/angular2-polymer';


import { AppComponent } from './app.component';
import { GridComponent } from './grid.component';

@NgModule({
  declarations: [
    AppComponent, GridComponent,
    PolymerElement('vaadin-grid')
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule
  ],
  providers: [ PeopleService ]
,
  bootstrap: [AppComponent]
,
  schemas: [ CUSTOM_ELEMENTS_SCHEMA ]

})
export class AppModule { 

However, using release 2.4.4 of Angular 2 this construct is invalid per this error message:

ERROR in Error encountered resolving symbol values statically. Calling function ‘PolymerElement’, function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/Angular Projects/gridExample/src/app/app.module.ts, resolving symbol AppModule in C:/Angular Projects/gridExample/src/app/app.module.ts.

You also cannot use
directives
in an @Component anymore as was shown on the Angular 2 examples on this page:

https://vaadin.com/elements/-/element/vaadin-grid

How can this issue be resolved?

Thanks…

Hi, Dan!

There are issues in using angular2-polymer together with Angular 2.3+ and AOT. See these issues (and possibly others):


https://github.com/vaadin/angular2-polymer/issues/104​


https://github.com/vaadin/angular2-polymer/issues/86​

Also, Vaadin is not actively supporting this project right now.
See the announcement in the project readme
.

We will be updating our marketing material to reflect this change shortly.

@Jouni is this fixed ? As I could not find the road-map related to this issue in Announcement section.

Yogesh: I don’t know if it’s fixed.

As said, Vaadin is no longer actively supporting the use of our elements with Angular, and you should ask the community directly who maintains the angular-polymer integration library (add comments in the existing issues in the repository).