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\._@[email protected]@@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[] = [];这样在渲染表单时,才会将值渲染出来!  


你可能感兴趣的:(angular2,primeNg)