Ahu*_*uva 3 angular2-upgrade primeng angular
升级到rc5后,并使用新版本重新安装primeng,我收到以下错误:
zone.js?1472019041780:484未处理的Promise拒绝:模板解析错误:无法绑定到'icon',因为它不是'button'的已知属性.("ver':hovered,'ui-state-focus':专注,'ui-state-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"): 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>
Run Code Online (Sandbox Code Playgroud)
依赖关系:
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';
Run Code Online (Sandbox Code Playgroud)
您需要将所有内容导入为xModule.请参阅Primafaces的博客以供参考.
新方法如下:
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 { }
Run Code Online (Sandbox Code Playgroud)
编辑:让我纠正自己.我使用子模块,只有一个子模块依赖于PrimeNg,所以我认为在那里导入dependecies就足够了.事实证明,我必须在我的app.module.ts(我的主模块)中导入这些模块,而不是在我的子模块中.可悲的是,我不知道确切的原因.
PS.:我不知道为什么你会得到'意外的价值'.您可以分享有关您项目的更多信息吗?
| 归档时间: |
|
| 查看次数: |
9908 次 |
| 最近记录: |