This is a migrated thread and some comments may be shown as answers.

Data binding and URLs don't work

1 Answer 26 Views
NativeScript Insiders
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
TJ
Top achievements
Rank 1
TJ asked on 28 Jan 2015, 07:39 PM
Hey all,

I'm trying to build a ListView full of images, and the parsing of URLs doesn't appear to be working. Here's the XML:

<Page navigatedTo="load">
    <GridPanel>
        <ListView items="{{ memes }}">
            <ListView.itemTemplate>
                <Image source="{{ url }}" />
            </ListView.itemTemplate>
        </ListView>
    </GridPanel>
</Page>

And here's the JS:

var observableModule = require( "data/observable" ),
    observableArray = require( "data/observable-array" ),
    data = new observableModule.Observable();
 
data.set( "memes", new observableArray.ObservableArray([
    { url: "https://google.com/favicon.ico" },
]));
 
exports.load = function( args ) {
    args.object.bindingContext = data;
};

If I hardcode <Image url="https://..."> the images work, and if I hardcode <Label text="{{ url }}" /> the URLs get parsed from the observable, so I'm not sure what's up. Any ideas?

Thanks,
TJ

1 Answer, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 30 Jan 2015, 11:58 AM
Hi TJ,

Indeed, there is a bug when binding an image. Thanks for the note!

We're investigating it and will have it fixed for the Beta release.

Best regards,
Erjan Gavalji
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
NativeScript Insiders
Asked by
TJ
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Share this question
or