Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Problem with ngFor in AngularJS #4

Open
jibon57 opened this issue May 15, 2017 · 5 comments
Open

Problem with ngFor in AngularJS #4

jibon57 opened this issue May 15, 2017 · 5 comments

Comments

@jibon57
Copy link

jibon57 commented May 15, 2017

Hi,

Thanks for the plugin. During my testing images were missed when I had tried to load multiple images in one page using ngFor. Will you please check?

<ScrollView orientation="vertical" >
        <StackLayout>
            <StackLayout class="cardStack" *ngFor="let post of articles" >
                <NSImage *ngIf="post.img.image_fulltext" style="height: 120; width: 120"  src="{{baseURL}}/{{post.img.image_fulltext}}"></NSImage>
            </StackLayout>
        </StackLayout>
    </ScrollView>

Thanks in advance :)

@bnussey
Copy link
Collaborator

bnussey commented May 15, 2017

Hey @jibon57 I haven't tried that but I've noticed an issue if height and width is not explicitly defined. I would try and put height and width as their own tags, not wrapped in style and see if that fixes it.

@mfrro
Copy link

mfrro commented May 30, 2017

Hey @bnussey I'm experiencing the same issue. Declaring the width & height as you've proposed works. However, in my implementation I would prefer not having to set width & height. I think images should be displayed even if width & height aren't set, do you agree?

@bnussey
Copy link
Collaborator

bnussey commented Jun 1, 2017

Hey @mfrro just try setting it as 100% for width and height.. I am also looking into a solution myself but haven't found anything yet.

@mfrro
Copy link

mfrro commented Jun 1, 2017

Setting a percentage value only works if the parent element has a set width & height. Maybe this will bring you closer to a solution.

This works:

<StackLayout width="200" height="200">
   <NSImage stretch="aspectFit" [src]="pictureUrl" width="100%" height="100%"></NSImage>
</StackLayout>

This doesn't work:

<StackLayout>
   <NSImage stretch="aspectFit" [src]="pictureUrl" width="100%" height="100%"></NSImage>
</StackLayout>

@bnussey
Copy link
Collaborator

bnussey commented Jun 1, 2017

Thanks @mfrro .. always open to a PR if you wanna work on this as well

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants