Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mycard Mobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GaiaXalter
Mycard Mobile
Commits
1dc716ed
Commit
1dc716ed
authored
Aug 24, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remve ngModel for currentServer
parent
4012759d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
src/app/server-select/server-select.component.html
src/app/server-select/server-select.component.html
+1
-1
src/app/ygopro.service.ts
src/app/ygopro.service.ts
+9
-3
No files found.
src/app/server-select/server-select.component.html
View file @
1dc716ed
环境:
<mat-form-field
appearance=
'standard'
>
<mat-select
[formControl]=
'ygopro.serverForm'
[(ngModel)]=
'ygopro.currentServer'
>
<mat-select
[formControl]=
'ygopro.serverForm'
>
<mat-option
*ngFor=
'let server of ygopro.selectableServers'
[value]=
'server'
>
{{server.name}}
</mat-option>
...
...
src/app/ygopro.service.ts
View file @
1dc716ed
...
...
@@ -140,7 +140,13 @@ export class YGOProService {
serversPromise
:
Promise
<
Server
[]
>
;
servers
:
Server
[]
=
[];
selectableServers
:
Server
[]
=
[];
currentServer
:
Server
;
get
currentServer
():
Server
{
return
this
.
serverForm
.
value
;
}
set
currentServer
(
server
:
Server
)
{
this
.
serverForm
.
setValue
(
server
);
}
constructor
(
private
login
:
LoginService
,
private
http
:
HttpClient
,
private
dialog
:
MatDialog
,
private
storage
:
StorageService
)
{
const
app
=
this
.
http
.
get
<
App
[]
>
(
'
https://sapi.moecube.com:444/apps.json
'
).
pipe
(
...
...
@@ -253,8 +259,8 @@ export class YGOProService {
return
condition
(
s
);
});
if
(
!
this
.
currentServer
||
!
this
.
selectableServers
.
includes
(
this
.
currentServer
))
{
this
.
currentServer
=
this
.
selectableServers
[
0
];
this
.
serverForm
.
setValue
(
this
.
currentServer
);
//
this.currentServer = this.selectableServers[0];
this
.
serverForm
.
setValue
(
this
.
selectableServers
[
0
]
);
}
}
...
...
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