File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
@page " /newportfolio"
2
- @using Model
3
2
@using Services
4
3
@using Utils
4
+ @using Model
5
5
@inject IPortfolioService PortfolioService
6
6
@inject IMatDialogService MatDialogService
7
7
@inject IMatToaster Toaster
8
- @inject Microsoft . AspNetCore . Components . NavigationManager NavigationManager
8
+ @inject NavigationManager NavigationManager
9
9
10
10
11
11
<style >
18
18
<div class =" mat-layout-grid-inner" >
19
19
<div class =" mat-layout-grid-cell mat-layout-grid-cell-span-2" ></div >
20
20
<div class =" mat-layout-grid-cell mat-layout-grid-cell-span-8" >
21
-
22
- <MatH5 ><MatButton Outlined =" true" Icon =" keyboard_arrow_left" Style =" margin-right: 1rem;" OnClick =' () => { NavigationManager.NavigateTo($""); }' >Back</MatButton ></MatH5 >
21
+
22
+ <MatH5 >
23
+ <MatButton Outlined =" true" Icon =" keyboard_arrow_left" Style =" margin-right: 1rem;" OnClick =' () => { NavigationManager.NavigateTo($""); }' >Back</MatButton >
24
+ </MatH5 >
23
25
<MatCard >
24
26
<MatCardContent class =" demo-mat-card-content" >
25
27
<h2 >New portfolio</h2 >
40
42
{
41
43
private void OnCreateFormSubmitted (PortfolioForm .NewPortfolioModel formModel )
42
44
{
45
+ // create the portfolio
43
46
PortfolioService .CreatePortfolio (formModel .Name , formModel .Description , formModel .SelectedCurrency );
47
+ // reset the model
44
48
formModel .Reset ();
49
+ // notify the user
45
50
Toaster .Add (" New portfolio successfully added" , MatToastType .Success , " " , " " );
46
51
}
47
52
}
You can’t perform that action at this time.
0 commit comments