-
-
Notifications
You must be signed in to change notification settings - Fork 147
This PR add Angular components WIP #243
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
base: master
Are you sure you want to change the base?
Conversation
|
awesome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @riderx - this is some great work! I came looking for Angular support myself, and this is great. Love this PR.
I've left a few comments as an early review (I realize it's still a draft). I spotted a few areas that could be simplified, and I'm happy to help if you'd like others to jump in.
My review comments are minor stuff, can be covered in incremental changes later too, but I do think it will help simplify the code quite a lot.
On a side note, this PR has gotten me interested in Claude yet again, with just how much the quality has improved over time.
| effect(() => { | ||
| const el = this.host()?.nativeElement; | ||
| if (!el) return; | ||
| el.setAttribute('class', this.classes()); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed. We can use host to update host classes automatically.
@Component({
selector: 'k-badge',
imports: [CommonModule],
template: `
<ng-content />
`,
host: {
[class]: "classes()"
},
changeDetection: ChangeDetectionStrategy.OnPush,
})This also removes the need for an extra span tag.
Usage:
<k-badge></k-badge>
<k-badge />
<k-badge class="m-2" />| </div> | ||
| } | ||
| } | ||
| `, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, this can be simplified a lot too.
@Component({
selector: '[kBreadcrumbsSeparator]',
imports: [CommonModule, KChevronIconComponent],
template: `
<k-chevron-icon [class]="iconClasses()" />
<ng-content />
`,
host: {
[class]: "classes()"
},
changeDetection: ChangeDetectionStrategy.OnPush,
})This removes the need for an extra parent host element tag by switching to an attribute selector. Also, why limit this to span/li/div?
If we wanted to limit it, then the selector can be updated to: span[kBreadcrumbsSeparator], li[kBreadcrumbsSeparator], div[kBreadcrumbsSeparator]
Usage:
<span kBreadcrumbsSeparator>Hey</span>
<div kBreadcrumbsSeparator>Hey</div>
<ul>
<li kBreadcrumbsSeparator>Hey</li>
</ul>
<span kBreadcrumbsSeparator class="m-2">Hey</span>
<div kBreadcrumbsSeparator class="m-2">Hey</div>
<ul>
<li kBreadcrumbsSeparator class="m-2">Hey</li>
</ul>|
Hey @riderx , thanks thats a lot of work! But as i mentioned earlier i won't be able to maintain it. So i can recommend to move it to a different repo under Konsta GitHub org, or to your account, and i can make a link to it on the website |
|
I’m up to take ownership if that on your org and on official website. |
|
@riderx ok, i created a new repo at https://github.com/konstaui/konsta-angular and invited you as a maintainer |
|
Thanks @nolimits4web i'm not sure how to do this. What do you think @nolimits4web |
|
Angular branch is not an option. I can just export all those classes and color utils from existing konsta package |
|
That a great idea ! |
|
@nolimits4web please pig me here when you do i will init the repo with it then |
|
@riderx added those exports in 5.0.4 |
|
thanks @nolimits4web i think we need the types as well. |
|
I think there is more |
Hey @riderx can you elaborate on this, what else is missing? |
|
We use style files and utility files, not sure it make sense of importing them in NPM. Maybe in another package ? |
Hello. I decided to try to integrate thanks to AI Angular components for Konsta as it's one of the most requested requests from all the users I shared it to.
It's very important for the Ionic community who have a lot of app base in Angular to have a Ionic or Capacitor library which is a good alternative to add a Ionic one because this one is based on Tailwind.
That's what I did, and I hope this will be useful.
I'm still working on it; some components have been implemented.