我已将此用角度CLI构建的库发布到npm,并想在某些项目中使用它,问题是,安装后,我似乎无法使用它。
无论我尝试导入Shared模块如何,都会发生以下错误:
function featchData(userId)
{
console.log(userId);
//if you get the id, write in the rest of the code here ;)
}
如果我尝试将其添加到将要使用它的模块中:
Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
但是在应用示例中,它运行良好,没有任何反应。寻找见解,在此先感谢!