Search code examples
angularprimengangular2-upgrade

primeng issues with rc5


After upgrading to rc5, and reinstalling primeng with the new release, I receive the following error:

zone.js?1472019041780:484 Unhandled Promise rejection: Template parse errors: Can't bind to 'icon' since it isn't a known property of 'button'. ("ver':hovered,'ui-state-focus':focused,'ui-state-disabled':disabled}" >][icon]="icon" pButton *ngIf="showIcon" (click)="onButtonClick($event,in)" [ngClass]="): Calendar@7:31 ; Zone: ; Task: Promise.then ; Value:

I tried removing all references to calendar, so I can at least get the app up and running, and got another issue:

Can't bind to 'rows' since it isn't a known property of 'p-paginator'.
1. If 'p-paginator' is an Angular component and it has 'rows' input, then verify that it is part of this module.
2. If 'p-paginator' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("              <ng-content select="header"></ng-content>
            </div>
            <p-paginator [ERROR ->][rows]="rows" [first]="first" [totalRecords]="totalRecords" [pageLinkSize]="pageLinks" styleClass="ui"): DataTable@6:25
Can't bind to 'first' since it isn't a known property of 'p-paginator'.
1. If 'p-paginator' is an Angular component and it has 'first' input, then verify that it is part of this module.
2. If 'p-paginator' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
 ("<ng-content select="header"></ng-content>
            </div>

dependancies:

import { NgModule, ElementRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { HttpModule } from '@angular/http';
import { Calendar, DataTable, Column, InputMask } from 'primeng/primeng';

Solution

  • As i hinted to in the comments above, there is a issue with RC5 which produces this error. In most cases, it is enough to disable minimization, or adjust the settings to the build, and configure uglify with mangle:

    { screw_ie8 : true, keep_fnames: true} or use AOT template compilation
    

    The source to this issue and the solution is github.com/angular/angular/issues/10618 this fix didn't work for me though, but i hope it will help other developers.