Comments (12)
Fixed with this:
isBrowser: boolean;
constructor(@Inject(PLATFORM_ID) private platformId: Object) {
if (isPlatformBrowser(this.platformId)) {
this.isBrowser = true;
}
}
<ng-container *ngIf="isBrowser">
<ngx-progressive-image-loader
[filter]="'blur(3px) drop-shadow(0 0 0.75rem crimson)'"
[placeholderImageSrc]="hero.avatarBlurredUrl">
<img (click)="seeHeroDetails(hero)" src="{{hero.avatarUrl}}" alt="" ngxProgressiveImage />
</ngx-progressive-image-loader>
</ng-container>
Maybe you should add some documentation on this or a demo...
Finally working here :)
from ngx-progressive-image-loader.
Yup so weird. You can reproduce the error just clone my project, upgrade the version, npm run build:ssr and npm run serve:ssr. You will see the error...
from ngx-progressive-image-loader.
I thought I had a demo? but thanks! This is still work in process. I will try to make it better and welcome to make a pull request.
from ngx-progressive-image-loader.
Could you try 4.0.0-beta.9? you don't need <ng-container *ngIf="isBrowser">
anymore in theory.
from ngx-progressive-image-loader.
Done, and yes, it's working as expected.
Thanks!!
from ngx-progressive-image-loader.
Thank you! Btw, I liked your project from long times ago. Thank you for creating that project.
from ngx-progressive-image-loader.
@Ismaestro also could you try 4.0.0-beta.12. I think it will help on things like some images are not loaded properly
from ngx-progressive-image-loader.
With that version while serving the app with ssr, I got this error:
> [email protected] serve:ssr /Users/iramos/WebstormProjects/angular7-example-app
> node dist/server
Node server listening on http://localhost:4000
/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:344
throw error;
^
TypeError: Cannot read property 'src' of undefined
at loadImage (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:279342:27)
at ProgressiveImageDirective.ngOnInit (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:279694:13)
at checkAndUpdateDirectiveInline (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:26202:19)
at checkAndUpdateNodeInline (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:27466:20)
at checkAndUpdateNode (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:27428:16)
Serving the app with JIT goes fine.
:)
from ngx-progressive-image-loader.
Weird. That doesn't make any sense. There are only 2 changes between 9 and 12, 819dae7 and 717c266 I don't understand how could it work on 9 but not 12
from ngx-progressive-image-loader.
I will try it sometime this week.
from ngx-progressive-image-loader.
I've also encountered an error while running with universal app
export '_window' (imported as 'i11') was not found in 'ngx-window-token'
"ngx-progressive-image-loader": "^3.0.2",
"ngx-window-token": "^2.0.1",
"tslib": "^1.10.0
Tried to recreate this with just angular and works fine.
Let me know if I missed something
from ngx-progressive-image-loader.
please try the latest beta version. 4.0.0-beta.15. I used it on production for a while already.
from ngx-progressive-image-loader.
Related Issues (11)
- Some images don't load properly and load after resizing HOT 3
- demo report wrong HOT 1
- NgxWindowTokenModule issue HOT 4
- Angular 9 Support
- ModuleWithProviders Error
- need to review this with Safari
- How is memory usage handled for image resizing HOT 1
- Add option to discard images when not in view
- Possible to use a flexible imageRatio (none stretch) HOT 6
- Need for include scss HOT 3
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-progressive-image-loader.