Closed h657070128 closed 7 years ago
If you post a small repro I can clone and tinker with, I can try debugging it.
@filipesilva Thanks, I will post one later.
The funny thing is that I set up a lib and a consuming application and tried to reproduce the issue. However I found the demo works just fine... Then I went back to double check my original code and found a stupid mistake - oops, forgot to import Clarity for that module (I am not using a centralized module). Thanks anyway!
That's not uncommon at all really, there are a lot of bugs I've discovered myself while trying to do a simple repro. Glad you got it sorted!
Hi, I am building a lib based on VMware's Clarity, which is also a Angular library. After the config, my component in lib, containing Clarity directives and components, works properly (the code under src/lib is used in the demo). However, after I successfully packaged it with rollup, the Clarity directive wrapped in my exported component does not work in another application (consuming application). I do not want Clarity and Angular included in my lib. Instead, that application will import Angular, Clarity and my lib. I believe this is the correct way.
My rollup config:
-------------------------------------------Separator-------------------------------------------
In the Angular-Cli based application, I
npm link
the dist directory of my lib (the solution before I publish the lib to npm repository). According to the instruction of Angular-Cli, I config thetsconfig.app.json
as:And the usage is like: (
app.module.ts
)Then I consume my component in
app.component.html
. The browser console reports error:because the component I consume (i.e. in my lib) contains Clarity directive
clr-dropdown
. I find the directive is not initialized in my consuming application by setting breakpoint in the directive constructor. Then of course the error is occurring.Did I miss something? Any possible ideas are all welcome. Thanks! It's may related to #21 but kind of different. I read through that thread but did not find the answer.