I m trying to make some experiments with NativeScript, but I m facing some weird error, and I can't get the point.
I m having a simple list of pokemons inside of my component :
import {Component} from '@angular/core';
import {Http} from '@angular/http';
@Component({
selector:'pokemon-list',
templateUrl: 'components/pokemonList/pokemonList.html'
})
export default class PokemonList {
pokemons: Array<any>;
constructor(private http:Http){
this.pokemons = [
{name: 'Bulbi', url: 'google.com'}
];
}
}
And having the following template associated :
<StackLayout>
<Label text="Pokemons" class="h1 text-center"></Label>
<ListView [items]="pokemons">
<template let-item="pokemon">
<pokemon-item [name]="pokemon.name" [url]="pokemon.url"></pokemon-item>
</template>
</ListView>
</StackLayout>
When I try to start the application, I'm having the following error in my console :
Error in components/pokemonList/pokemonList.html:4:20 caused by: undefined is not an object (evaluating 'self.parentView.context.pokemon.name')
What am I doing wrong ? :/