themyth92 / ngx-lightbox

Lightbox2 use with angular >= 5
MIT License
115 stars 66 forks source link

Not Working With Angular 7 #9

Closed shivarajnaidu closed 5 years ago

shivarajnaidu commented 5 years ago

This library not working with angular 7.. And Examples also have mistakes

themyth92 commented 5 years ago

What you mean by not working ? What error you saw ? What part of example has mistake ?

shivarajnaidu commented 5 years ago

Simply even not throwing errors.. Nothing happening.. and examples also have errors.. Type errors

themyth92 commented 5 years ago

examples also have errors.

Can you show me which part of the example have errors ?

themyth92 commented 5 years ago

Simply even not throwing errors..

Did you include the CSS file into your html ?

themyth92 commented 5 years ago

https://github.com/themyth92/ngx-lightbox#installation

themyth92 commented 5 years ago

Close due to no activity from issuer.

karthikeyansant commented 5 years ago

lightbox is not working in my angular7 project

omikolaj commented 5 years ago

I am seeing weird behavior with lighthouse in my angular project also. For example whenever I try to open an image the entire overlay of lighthouse dialog has css properties of display: none. I cannot see anything. What i do see, is a second scrollbar showing up and when i scroll all the way down i have huge white space. When i manually enable display: block properties on my image, i can view the image just fine, but the styling is off.

themyth92 commented 5 years ago

@omikolaj I think there maybe some css conflict somewhere. Did you include the lightbox css into your app ? Also any errors throw from console @karthikeyansant Seems angular7 working fine for me locally. Not sure what error you saw on your end.

paoespinoza commented 5 years ago

Same issue here, my lightbox is not working, I'm getting a undefined error. I'm using angular 7 and "ngx-lightbox": "1.2.0"

I included the css in my component: @Component({ selector: 'product-damage', templateUrl: './productDamage.component.html', styleUrls: [ '../../../../node_modules/ngx-lightbox/lightbox.css'], moduleId: module.id.toString() })

My array of images look like that: 0: caption: "Image 1" src: "https://media/Images/822ee069-ab25-4e04-b8e9-a207f779028d.jpeg" thumb: "https://media/Images/822ee069-ab25-4e04-b8e9-a207f779028d.jpeg" 1: caption: "Image 1" src: "https://media/Images/822ee069-ab25-4e04-b8e9-a207f779028d.jpeg" thumb: "https://media/Images/822ee069-ab25-4e04-b8e9-a207f779028d.jpeg"

And Im using the code exactly how it shows is in the example.

The error: ERROR TypeError: Cannot read property 'forEach' of undefined at LightboxComponent.ngOnInit (lightbox.component.js:49) at checkAndUpdateDirectiveInline (core.js:18537) at checkAndUpdateNodeInline (core.js:19801) at checkAndUpdateNode (core.js:19763) at debugCheckAndUpdateNode (core.js:20397) at debugCheckDirectivesFn (core.js:20357) at Object.eval [as updateDirectives] (LightboxComponent_Host.ngfactory.js? [sm]:1) at Object.debugUpdateDirectives [as updateDirectives] (core.js:20349) at checkAndUpdateView (core.js:19745) at callWithDebugContext (core.js:20639)

imrahulmpawar commented 5 years ago

Try this it worked for me.

nectorosales commented 5 years ago

Hello, the truth is that I do not waste time making many comments, but the lightbox does not work properly in Angular 7 and the example described has some errors such as the variable "_albums" where it is initialized, you ate an "s". I would not recommend the use of this library

themyth92 commented 5 years ago

Hey @nectorosales, if you think the library has error, you can submit PR to fix it instead of staying here and complains about a "typo". Thanks.

nectorosales commented 5 years ago

Hello @themyth92, not just a typographical error, this library is adapted to a specific object that should carry the src parameter "{ src: "url-image" }" and does not give you the freedom to specify the route as you want. If I have an object with the parameter name "{ name: "name-image"}" I already have to make changes to adapt the library. Still I have to say that it works very well but I would adapt it for any object.