[Ionic V2 - Android]
Hello I’m currently working on my first app, and encountering some problems…
I have a couple of images in my app, which are located both in src/assets/img and www/assets/img and one json file which is located in src/assets/json and www/assets/json (this post here recommended doing that, but it hasn’t solved my problem)
The json file is used to display a list of food names and some numbers associated with them, and the images are used as a background image and in recipes. Now, the background images work, but the recipe images and the food list don’t, and I’m not sure why…
This is how the background images are used in start.scss:
.start-background-1 {
background: url("../assets/img/level1.png") fixed;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
This is how the recipe images are used in recipes.ts:
this.recipes = [
{ id: 0, title: 'Chili sin Carne', imageUrl: '../assets/img/0.jpg',
category: 'einfach', co2: 497, recipeIngredients: this.ingredient_CsC,
method: 'some text'},
//more recipes
]
This is how the json file is used in start.ts:
this.http.get('../assets/JSON/ingredients_exhibition.json')
.map(res => res.json())
.subscribe((data) => {
this.ingredients = data;
console.log(this.ingredients);
window.localStorage.setItem("ingredient_list", JSON.stringify(this.ingredients));
});
If you need any other info, please ask, since I’m not sure where the problem lies exactly I’m not sure what information is useful…