與RC5

2016-08-24 53 views
3

primeng問題升級到RC5,並重新安裝primeng新版本後,我收到以下錯誤:與RC5

zone.js 1472019041780:484未處理的承諾拒絕:模板解析錯誤:無法綁定到'icon',因爲它不是'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:

我試着刪除對日曆的所有引用,所以我至少可以獲取應用程序啓動和運行,並得到了另一個問題:

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"): [email protected]: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> 

依賴關係:

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'; 
+0

重新排序和編輯縮小,如下sugested HTTPS:/ /github.com/angular/angular/issues/10618,現在在另一個對象上得到相同的錯誤:'zone.js?1472029134433:484未處理的Promise拒絕:模板解析錯誤: 無法綁定到'showItBootstrap',因爲它不是'a'的已知屬性。 (「k」=「['/ about']」>關於' – Ahuva

回答

0

正如我在上面的評論暗示,有一個問題與RC5產生這種錯誤。在大多數情況下,它足以禁用最小化,或者調整到構建的設置,並配置有軋液醜化:

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

源到這個問題,解決的辦法是github.com/angular/angular/issues/10618 此修復程序並沒有爲工作我雖然,但我希望它會幫助其他開發者。

6

需要導入的一切作爲xModule見Primafaces' blog供參考。

的新方法如下:

import {NgModule}  from '@angular/core'; 
import {InputTextModule,DataTableModule,ButtonModule,DialogModule} from 'primeng/primeng'; 

@NgModule({ 
    imports:  [BrowserModule,InputTextModule,DataTableModule,ButtonModule,DialogModule], 
    declarations: [AppComponent], 
    bootstrap: [AppComponent], 
    providers: [CarService] 
}) 
export class AppModule { } 

編輯:讓我糾正自己。我使用子模塊,並且只有一個子模塊依賴於PrimeNg,所以我認爲在那裏導入依賴關係就足夠了。事實證明,我必須在我的app.module.ts(我的主模塊)中導入這些模塊,而不是在我的子模塊中。可悲的是,我不知道確切的原因。

PS:我不知道你爲什麼會得到'意想不到的價值'。你能分享更多關於你的項目的信息嗎?

+0

歡迎您訪問潛在解決方案的鏈接,但請爲未來的訪問者添加一些詳細信息以防鏈接不再可用 –

+0

thanks。got Unexpected value' xModule'模塊'AppModule'(...) – Ahuva

+0

聲明顯然這是一個已知的錯誤,我得到它的幾個三維零件包,但沒有建議的'變通辦法'幫助看到github.com/angular/angular/issues/10618 – Ahuva

0

我想補充說的是,不僅需要導入所有內容,還需要在system.config.js中輸入 ,您需要在packageNames中添加@angular/forms。另外,在你的啓動或主要需要更改爲以下:

import {platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 
import {AppModule } from './app.module'; 
platformBrowserDynamic().bootstrapModule(AppModule); 

我得到了總理的DataTable與RC5和primeng 1.0.0-beta.14工作