Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
s8_ivanov_r
VPL-pizza-shop-blazor
Commits
808d9dbc
Commit
808d9dbc
authored
Jan 25, 2019
by
Ryan Nowak
Browse files
Fix a bug in configure pizza.
The toppings shouldn't be a parameter since it initialize it on the page.
parent
3c925a16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/BlazingPizza.Client/Shared/ConfigurePizzaDialog.cshtml
src/BlazingPizza.Client/Shared/ConfigurePizzaDialog.cshtml
+6
-6
No files found.
src/BlazingPizza.Client/Shared/ConfigurePizzaDialog.cshtml
View file @
808d9dbc
...
...
@@ -17,7 +17,7 @@
</div>
<div>
<label>
Extra Toppings:
</label>
@if (
AllT
oppings == null)
@if (
t
oppings == null)
{
<select
class=
"custom-select"
disabled
>
<option>
(loading...)
</option>
...
...
@@ -31,9 +31,9 @@
{
<select
class=
"custom-select"
onchange=
"@ToppingSelected"
>
<option
value=
"-1"
disabled
selected
>
(select)
</option>
@for (var i = 0; i
<
AllT
oppings.Count
;
i
++)
@for (var i = 0; i
<
t
oppings.Count
;
i
++)
{
<
option
value=
"@i"
>
@
AllT
oppings[i].Name - (£@(
AllT
oppings[i].GetFormattedPrice()))
</option>
<
option
value=
"@i"
>
@
t
oppings[i].Name - (£@(
t
oppings[i].GetFormattedPrice()))
</option>
}
</select>
}
...
...
@@ -62,19 +62,19 @@
</div>
@functions {
[Parameter]
List
<Topping>
AllT
oppings { get; set; }
List
<Topping>
t
oppings { get; set; }
Pizza Pizza => OrderState.ConfiguringPizza;
protected async override Task OnInitAsync()
{
AllT
oppings = await HttpClient.GetJsonAsync
<List
<
Topping
>
>("/toppings");
t
oppings = await HttpClient.GetJsonAsync
<List
<
Topping
>
>("/toppings");
}
void ToppingSelected(UIChangeEventArgs e)
{
if (int.TryParse((string)e.Value, out var index)
&&
index >= 0)
{
OrderState.AddTopping(
AllT
oppings[index]);
OrderState.AddTopping(
t
oppings[index]);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment