import { DirectiveName } from 'path/to/directive';
@NgModule({
declarations: [DirectiveName],
...
})
export class AppModule { }
import { ThirdPartyModule } from 'path/to/third/party/library';
@NgModule({
imports: [ThirdPartyModule],
...
})
export class AppModule { }
其中,[directiveProperty]应该是该指令的属性,而不是DIRECTIVE本身。
如果以上方法都尝试过了还是无法解决问题,可以检查该指令的实现是否存在问题。