Comments (7)
AT TIME:
- I just released a new version with the suggestions and they're available in
[email protected]
. More details about the changes in https://github.com/willmendesneto/ngx-skeleton-loader/blob/master/CHANGELOG.md#270---2021-02-06
from ngx-skeleton-loader.
Hey @willmendesneto sorry for late response. I saw that you made progress with this, and I'd want to say thanks for this awesome lib and for providing a fast feedback on these suggestions.
Btw, could we have a way to pass a default config to the .forRoot()
?
It'd be really nice to set a custom loadingText
globally, and why not the other properties as well.
That being said, let me try to address the remaining two points...
Actually, this is a design decision. Since you can use
[theme]
for it, there's no reason to support NgStyle via attribute bindings, like the scenario you described. For it you can use something like{"max-width": "100px"}
should work as expected and I never received any message with scenarios when a binding in[theme]
was required.
Hmm, I don't think my suggestion was clear enough. Let me try to explain better now...
As the [theme]
@Input
is just a bridge to pass an style
via [ngStyle]
as we can see here:
I don't get why it isn't compatible with NgStyle
and that's why I was suggesting to use the same signature of [ngStyle]
({ [klass: string]: any; }
) in [theme]
.
Could you share a real scenario when you'll have to use AsyncPipe for it and that
ngAcceptInputType_*
? I'm just concerned that won't be a realistic scenario and maybe sharing something specific you're facing might help on that.
We don't even have to go that far, by using examples with AsyncPipe
, just try to use (in a application with strict mode enabled) like in README:
<ngx-skeleton-loader count="5"></ngx-skeleton-loader>
You'll receive Type 'string' is not assignable to type 'number'.
from ngx-skeleton-loader.
Sharing some updates:
- strict types are now available on the package;
theme
attribute is now following the same types asngStyle
. So now it can be used as style attributes as well, having both the same signature.
from ngx-skeleton-loader.
I'm closing this issue for now since it was a lot of issues in a single one. Please feel free to open a single issue, so we could discuss more and see if it's valuable for the module!
And thanks again for raising those points ๐
from ngx-skeleton-loader.
Hi @rafaelss95 , thanks for raising this issue.
Ok, so let's try to discuss each of these points since it's an issue covering different points:
- Use OnPush change detection for performance reasons
- @input for changing the "Loading..." text
- Also, it seems that animation can't accept literal false
Nice findings. I'm applying these changes at the moment, thanks for the suggestions!
Another thing is that the theme is not compatible with NgStyle, so we can't pass something like {'max-width.px': widthExp} as the current signature is {[k: string]: string;}
Actually, this is a design decision. Since you can use [theme]
for it, there's no reason to support NgStyle via attribute bindings, like the scenario you described. For it you can use something like {"max-width": "100px"}
should work as expected and I never received any message with scenarios when a binding in [theme]
was required.
Better typings with strict mode...
Could you share a real scenario when you'll have to use AsyncPipe for it and that ngAcceptInputType_*
? I'm just concerned that won't be a realistic scenario and maybe sharing something specific you're facing might help on that.
from ngx-skeleton-loader.
Thanks for elaborate on the issue. Maybe we should split that in few other issues to make it easier to manage, but definitely some improvements to be added!
Iโm not sure if Iโll have some time these days to apply that, but pull requests are more than welcome (Itโs totally fine if you canโt raise them, I can add them)!
from ngx-skeleton-loader.
Hey @willmendesneto, thanks for addressing this! I've just updated right now and I've encountered a problem that I reported in #61 and a missing suggestion in #62.
from ngx-skeleton-loader.
Related Issues (20)
- Skeleton loader animation scrolls outside of mat-card container HOT 1
- Suggestion: adjust peerDependencies to match ng 12 and above HOT 3
- How to change the pulse color ? HOT 2
- Support angular 14 HOT 5
- Add oblique animation option
- "Starting dev server" for a long time HOT 1
- Problem with using Appearance="line" in Mat-Table HOT 1
- Error in component.d.ts after Importing the ngx-skeleton-loader to app.module.ts in Angular 14.2.7 HOT 7
- Possible Angular Universal memory leak HOT 6
- Module parse failed: Unexpected token (56:32) HOT 5
- Unable run in Angular 11 HOT 2
- Version 8 is not published in Releases HOT 2
- Error Angular 10 HOT 1
- Make ngx-skeleton-loader standalone compliant HOT 3
- Possibility to use own svg HOT 1
- demo no workey? HOT 1
- Can't bind to 'theme' since it isn't a known property of 'ngx-skeleton-loader' HOT 1
- Ivy Distribution Error HOT 6
- Component theme should not replace forRoot theme HOT 3
- v13 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-skeleton-loader.