Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple Data From Components / Make ngx-admin installable #5869

Open
1 of 3 tasks
dapperdandev opened this issue Jun 28, 2021 · 2 comments
Open
1 of 3 tasks

Decouple Data From Components / Make ngx-admin installable #5869

dapperdandev opened this issue Jun 28, 2021 · 2 comments

Comments

@dapperdandev
Copy link

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request
  • question about the decisions made in the repository

Issue description

Current behavior:
I'm in the process of developing some apps in an nx monorepo. I've put most of the ngx-admin components in a lib, which I import into the apps in the monorepo.

Many of the components have data tightly coupled with them. tree-grid.component.ts is an example. This forces developers to modify the template/theme source files.

The main concern here is that developers on my team shouldn't be able to easily modify ngx-admin code. Ideally, they should import the components into the apps and perform overrides there.

Thinking about it like bootstrap is easier. I can install bootstrap, import it, then add any overrides I want to my own styles.scss. I don't need to create a "bootstrap" lib, copy the source code over, and edit it in place.

Below is a loose example of my project's structure.

workspace/
├── apps/
│   ├── user/
│   └── admin/
├── libs/
│   ├── user/
│   │   └── data-access/
│   ├── admin/
│   │   └── data-access/
│   └── shared/
│       └──  templates/
│            └── ngx-admin/    # would work better as an package on npm

Desired behavior:
Ideally, I would be able to ng add ngx-admin (or even just npm install) and import the components that way, rather than creating a lib for them. This would ensure developers would use the components as they were designed and modifications/overrides would happen in the apps or in custom themes.

In order for this to be possible, components would need to be modified to take @Input values rather than housing the data themselves.

Steps to reproduce:
N/A

Related code:
N/A (though I could spin one up if this ticket gets any attention :) )

Other information:

npm, node, OS, Browser

  • Windows 10
  • Chrome, Edge

Angular, Nebular

  • @angular/core: 12.0.0
  • @nebular/theme: ^7.0.0
@AsuScholar
Copy link

Glad I found this. I want to use the ngx-admin template as well. Was wondering about how I would convert this to a mono repo via nx workspaces.

I really love your idea of breaking components out into a separate library that can be added to a project and then import only what you need.

Let me know if I can help in any way .

@Prefix1802
Copy link

Sounds to me that you could use this. -> https://angular.io/guide/schematics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants