ngneat / content-loader Goto Github PK
View Code? Open in Web Editor NEW⚪️ SVG component to create placeholder loading, like Facebook cards loading.
Home Page: https://netbasal.com/
License: MIT License
⚪️ SVG component to create placeholder loading, like Facebook cards loading.
Home Page: https://netbasal.com/
License: MIT License
When doing so, it simply creates a circle
Based my circle on:
https://stackoverflow.com/questions/8193675/draw-a-hollow-circle-in-svg
so:
<content-loader [viewBox]="'0 0 800 800'">
<svg:circle cx="100" cy="100" r="100" fill="#fff"></svg:circle>
<svg:circle cx="100" cy="100" r="80" fill="transparent"></svg:circle>
</content-loader>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
We're in the process of upgrade from Angular 12 to 14, and are also upgrading our dependencies to the latest versions. We were using v4 of content loader, and bumped to v7. We're seeing build failures due to the use of the "height" and "width" inputs, which after investigating the code, were removed in v6. This breaking change was not documented, nor is an alternative suggested, so we will need to figure out how to maintain the expected behaviour without the benefit of documentation.
Breaking changes to component inputs are documented and alternatives are potentially suggested, where reasonable.
Use the <content-loader>
component and attempt to set [height]
and/or [width]
inputs.
An undocumented breaking change makes for a poor developer experience when upgrading libraries.
Angular version: 14.2.0
Browser: N/A
For Tooling issues:
- Node version: 16.16.0
- Platform: Linux
Others:
This is an Nx environment, fwiw, but that generally has no effect on
Is there any change that you can add Angular 9 support? Would be very pleased if you do so.
hello, could you please support the option style
so we can apply width and height to <svg>
?
Thanks for the fantastic library! I came across an issue with it, and hopefully the below provides a solution too:
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
When using queryParams in an Angular project, window.location.pathname is not sufficient to determine the URL. SVGs appear black in Safari as a result.
SVGs should display as normal in Safari, even when using queryParams.
A new Angular project, with content-loader installed, and a single route. Add a queryParameter to the end of the URL, and the SVG will no longer load.
Fix a bug
Angular version: Any
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [x] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
Others:
The following fork includes a commit which appears to fix this issue:
https://github.com/timminss/content-loader
I recommend adding some basic unit and e2e tests maybe together with sauce labs to test different browsers and platforms.
Hi !
First of all tks for this module.
But I am facing an issue since weeks.
After installing the module I am getting a cant find module
error when I try to build with prod option.
Upgraded to Angular 11
facebook, list and bullets components work but not raw.
Sample project attached.
test-hammer.zip
The package is hosted with the name @netbasal/content-loader
and not @netbasal/ngx-content-loader
.
Yarn: https://yarnpkg.com/en/package/@netbasal/content-loader
Npm: https://www.npmjs.com/package/@netbasal/content-loader
i want to use loader for rtl content.
angular version: 6.1.7
This is related to #36 and or a continuation of it since it got closed.
I still do not see this working even with doing the what your link in #36 says
Things I tried:
Removing completely which then angular 8 (not sure about previous versions) gives this
Error: No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.
I provide the APP_BASE_HREF in the module which gets the error gone but the svgs still are not being renderd.
I think the proper solution is an @input() for the base url property which is what this added.
danilowoz/react-content-loader#93
Without baseUrl it seems cannot have the <base href="/">
which Angular 8 seems to complain about it not being there.
Unless I am missing something?
Thoughts?
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:
I would like to extract all svg definition from the template to a "skeleton library file" so as to keep my template as clean as possible and let the skeleton library file take care of the skeleton definitions.
I guess I am looking for similar behaviour as the <use>
element in <svg>
with ahref
attribute that could be the location of my skeleton definition in the library file.
Ultimately I would only add the content-loader and props into my template, something like :
<content-loader
[viewBox]="viewBox"
baseUrl="pathToMyFile.svg#{{ icon }}"
>
</content-loader>
The "skeleton library file" would contain a list of skeleton definition for ex :
<svg:rect id="skeleton-one" x="0"
y="0"
rx="4"
ry="4"
width="60"
height="20" />
Is there any way to get that abstraction to separate the skeleton definition from the template ?
Angular version:14.0.3
Browser:
- [x] Chrome (desktop) version 108.0.5359.94
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
The content-loader displays just fine in Chrome, but has a way different and unexpected behaviour in IE 11.
The Loader shrinks to a 3x3 cm area where there should be a loader covering the whole page, 20x20cm and bigger.
Internet Explorer Version: 11.0.9600.19080
[*] Bug report
Named router outlet pathnames (with double slash) reproduce same issue with black rendered svg
Angular version: 8.2.8
Browser:
- [*] Chrome (desktop) version 77
Others:
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:
I saw that on github latest version of ngx-content-loader
lib is 7.0.0, but on NPM the latest version is 3.0.0. @NetanelBasal can you publish the latest version on NPM?
If don't have time to do this let me know and I can take a look into getting dependencies updated.
I am really confused when it comes to the two packages.
These both exist in NPM:
It looks like you published to ngx-content-loader. However, this one does not work for me it seems? but content-loader does.
How I am using it:
<content-loader>
<svg:rect x="0" y="0" rx="3" ry="3" width="100%" height="10" />
<svg:rect x="20" y="20" rx="3" ry="3" width="100%" height="10" />
<svg:rect x="20" y="40" rx="3" ry="3" width="100%" height="10" />
<svg:rect x="0" y="60" rx="3" ry="3" width="100%" height="10" />
<svg:rect x="20" y="80" rx="3" ry="3" width="100%" height="10" />
<svg:rect x="20" y="100" rx="3" ry="3" width="100%" height="10" />
</content-loader>
It seems like the old one /content-loader for the clip-path has something like clip-path="url(#uy19jgwmh8a)"
but for the latest version of the ngx-content-loader one it puts in http:// in it like so clip-path="url(https://ngx-content-loader.stackblitz.io/#u5gh7bxo95n)"
<--- did this via stackblitz which your example is not using latest version either by the way.
It seems this maybe a localhost issue where the svg is not rendering with localhost?
Seems this issue is related:
#28
I feel like the clip-path can just be the id? not really sure though I do not know much about how this works so hoping you will have more insight.
thoughts on this?
Hello guy's I am using this package to show the reactive content loader, I made an simple example on stackblitz which show the reactive content, please check below URL's
https://stackblitz.com/edit/reactive-contentloader
Also please check the output URLs below, the output URL 1 will display the content loader while the output URL 2 does not, I figure out this is because of query string parameter, if I remove the query string and reload the page it shows the content loader. How can I fix this issue.
Output :
https://reactive-contentloader.stackblitz.io/
https://reactive-contentloader.stackblitz.io/?q=hello
In routes different than home page - '/' all of loaders are black blocks. This happens only in safari - desktop and mobile.
I reproduced this bug in posted demo app. I upgraded the lib version to 2.0.0
The same is happening in my application using angular 7.
https://ngx-content-loader-hqrrey.stackblitz.io - this works fine
https://ngx-content-loader-hqrrey.stackblitz.io/route - this is broken
link to editor:
https://stackblitz.com/edit/ngx-content-loader-hqrrey
There are responsive issues in web and mobile. Is there any possibility to change width according to screen sizes
I tried to do integrate this in other components and it doesn't work. I don't get any errors and I am checking from my chrome console that it is not rendered in the same way like in the app component that works fine, by the way.
Hi,
ngx-content-loader works fine on angular 7, but it would be great to update his peer dependencies to angular 7 to avoid npm warnings.
npm WARN @netbasal/[email protected] requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @netbasal/[email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
Ideally, others npm packages use corresponding package version with angular aka:
[email protected] for angular 7 or [email protected] for angular 6
Thx !
I Checked the loader on different devices and it works very nice, but on my iPhone 6s it shows a black box instead of desired output
For:
<facebook-content-loader> </facebook-content-loader>
<list-content-loader> </list-content-loader>
<bullet-list-content-loader> </bullet-list-content-loader>
"viewBox" and "backgroundColor" is not working
The library fails to build when an angular application is built with AOT (https://angular.io/guide/aot-compiler) enabled (such as --prod setup with the angular cli). The following error occurs:
ERROR in ./node_modules/@netbasal/content-loader/content-loader.ngfactory.js
Module not found: Error: Can't resolve 'content-loader' in '/path/to/application/node_modules/@netbasal/content-loader'
Hi,
Would it be possible to create a new version with upgraded dependencies now that angular6 has been released?
Maybe keep 1.0.2 for Angular5 and have 1.6.0 for Angular6 (Or something that indicate the dependency or angular 6)
I've made an example on CodeSandbox
It will render normal if the url don't have the query params.
But when have any query params, it will show black block instead of svg we need.
Please see the image below.
It's happen on safari
Thanks!
ERROR in ./node_modules/@netbasal/content-loader/content-loader.ngfactory.js
Module not found: Error: Can't resolve 'content-loader' in '/Users/fernandolucasgontijo/Documents/Nagro/frontend/node_modules/@netbasal/content-loader'
Seems like you missed to include the README.md when you ran npm publish
so the npm page of the library shows an empty description. This is a problem I just caught within the ng-lib-schematics
you used to generate the library. I'll open a PR adding that to the build workflow. For now I suggest you to create a new patch version and manually include README.md inside dist, then publish the new version.
As mentioned here having a proper README in the npm registry is good to appear on npm searches, and I guess that ranks your library as well in search engines.
When window.location.href
is appended to fill and clipping refs and a hash is already in the URL the refs do not work. I don't know why the full href is needed, works perfectly fine with just a conventional ID hash reference.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.