Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is there a way to still have the use of default photo if none is available, but still use *ngIf binding? #10

Open
Tanker21 opened this issue Nov 20, 2020 · 0 comments

Comments

@Tanker21
Copy link

I kind of liked having a default photo if none was added to a recipe, but still want to use the class binding that contains the img tag. I see that *ngIf can handle an if...else, but I cannot seem to get it to work. I tried:

and also:

)

but keep getting this error:

Error: src/app/components/recipe-summary/recipe-summary.component.html:4:41 - error NG5002: Parser Error: Unexpected token / at column 50 in [recipe.cover_photo; then recipe.cover_photo else /assets/emptybowl.jpg] in D:/Documents/Learning/Web/Angular/recipes/src/app/components/recipe-summary/recipe-summary.component.html@3:40

4 <div class='cover-photo-holder' *ngIf="recipe.cover_photo; then recipe.cover_photo else /assets/emptybowl.jpg">

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

No branches or pull requests

1 participant