天天看點

如何找到Angular應用的某個directive是屬于哪一個Angular module

Suppose I would like to use SAP Spartacus directive cxComponentWrapper in my custom Component,and error message is:

Can’t bind to ‘cxComponentWrapper’ since it isn’t a known property of ‘ng-container’.\n1.

This is caused by missing import. However, how can we know which module should be imported from where?

The tip is to check it out in SAP Spartacus source code. Suppose you have already cloned it from github:

https://github.com/SAP/spartacus

search source code by keyword “cxComponentWrapper”, there should be plenty of hits, for example tab-paragraph-container.component.html:

如何找到Angular應用的某個directive是屬于哪一個Angular module
如何找到Angular應用的某個directive是屬于哪一個Angular module
如何找到Angular應用的某個directive是屬于哪一個Angular module
如何找到Angular應用的某個directive是屬于哪一個Angular module
如何找到Angular應用的某個directive是屬于哪一個Angular module

繼續閱讀