Giter Site home page Giter Site logo

Comments (7)

willmendesneto avatar willmendesneto commented on May 18, 2024 1

AT TIME:

from ngx-skeleton-loader.

rafaelss95 avatar rafaelss95 commented on May 18, 2024 1

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()?

static forRoot(): ModuleWithProviders<NgxSkeletonLoaderModule> {

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.

willmendesneto avatar willmendesneto commented on May 18, 2024 1

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.

willmendesneto avatar willmendesneto commented on May 18, 2024 1

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.

willmendesneto avatar willmendesneto commented on May 18, 2024

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.

willmendesneto avatar willmendesneto commented on May 18, 2024

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.

rafaelss95 avatar rafaelss95 commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.