angular2+primeNg报错记录

1.Property binding ngForOf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations"

需要再该模块的module里导入CommonModule,还要在父模块里导入BrowserModule !

2.assign to 'Data' because it is not a variabl

创建局部变量的时候要用let或者var!!!!只有全局变量才不要加这些!

3.改变angular2的4200端口

1、定位到:..\node_modules\._@angular_cli@1.0.1@@angular\cli\lib\config

2、打开schema.json

3、修改

"serve": {
  "description": "Properties to be passed to the serve command.",
  "type": "object",
  "properties": {
    "port": {
      "description": "The port the application will be served on.",
      "type": "number",
      "default": 4200
    },
  "default": 4200
4.很多时候我们在加载页面的时候去查询后台数据,组成下拉表单的选项内容,。在定义下拉表单内容时,必须初始化,不能只是定义没有初始化。
例如:只是定义 a:any; 定义加初始化:a:any[] = [];这样在渲染表单时,才会将值渲染出来!  


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值