ng serve --prod

lib项目中的example调试时要加上--prod参数,使得开发环境和生产环境保持一致

Please add a @NgModule annotation.

使用ng-packagr打包时export需要加上index

  1. // previous
  2. export * from './src'
  3. // now
  4. export * from './src/index'

在源代码中导入源代码文件时要指定文件名

  1. // previous
  2. import { Comp } from '../comp';
  3. // now
  4. import { Comp } from '../comp/comp.component';

since the query selector wasn't defined.

使用viewChild时加上forwardRef

  1. // previous
  2. @ViewChild(SelectComponent)
  3. compSelect: SelectComponent;
  4. // now
  5. import { forwardRef } from '@angular/core';
  6. @ViewChild(forwardRef(() => SelectComponent))
  7. compSelect: SelectComponent;