Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
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
MyCard
console
Commits
364b4620
Commit
364b4620
authored
Dec 30, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit
parent
3537c44c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
110 additions
and
17 deletions
+110
-17
app/app-detail.component.css
app/app-detail.component.css
+11
-0
app/app-detail.component.html
app/app-detail.component.html
+48
-0
app/app-detail.component.ts
app/app-detail.component.ts
+25
-0
app/app.service.ts
app/app.service.ts
+5
-4
app/apps.component.html
app/apps.component.html
+4
-3
app/apps.component.ts
app/apps.component.ts
+1
-1
app/mycard.component.css
app/mycard.component.css
+3
-0
app/mycard.component.html
app/mycard.component.html
+1
-1
app/mycard.module.ts
app/mycard.module.ts
+2
-1
app/routing.module.ts
app/routing.module.ts
+10
-7
No files found.
app/app-detail.component.css
0 → 100644
View file @
364b4620
.my-content
{
min-height
:
1000px
;
}
md-sidenav
{
width
:
200px
;
}
.example-full-width
{
width
:
100%
;
}
\ No newline at end of file
app/app-detail.component.html
0 → 100644
View file @
364b4620
<md-sidenav-container
*ngIf=
"app"
>
<md-sidenav
mode=
"side"
opened=
"true"
>
<md-nav-list>
<a
md-list-item
href=
"#"
>
详情
</a>
<a
md-list-item
href=
"#"
>
文件
</a>
</md-nav-list>
</md-sidenav>
<div
class=
"my-content"
>
<h3
md-subheader
>
基本信息
</h3>
<form
class=
"example-form"
>
<md-input-container
class=
"example-full-width"
>
<input
md-input
name=
"id"
placeholder=
"ID"
disabled
[(ngModel)]=
"app.id"
>
</md-input-container>
<md-input-container
class=
"example-full-width"
>
<input
md-input
name=
"name"
placeholder=
"First name"
[(ngModel)]=
"app.name['zh-CN']"
>
</md-input-container>
<p>
<md-input-container
class=
"example-full-width"
>
<textarea
md-input
placeholder=
"Address"
>
1600 Amphitheatre Pkwy
</textarea>
</md-input-container>
<md-input-container
class=
"example-full-width"
>
<textarea
md-input
placeholder=
"Address 2"
></textarea>
</md-input-container>
</p>
<table
class=
"example-full-width"
cellspacing=
"0"
><tr>
<td><md-input-container
class=
"example-full-width"
>
<input
md-input
placeholder=
"City"
>
</md-input-container></td>
<td><md-input-container
class=
"example-full-width"
>
<input
md-input
placeholder=
"State"
>
</md-input-container></td>
<td><md-input-container
class=
"example-full-width"
>
<input
md-input
#postalCode
maxlength=
"5"
placeholder=
"Postal Code"
value=
"94043"
>
<md-hint
align=
"end"
>
{{postalCode.value.length}} / 5
</md-hint>
</md-input-container></td>
</tr></table>
</form>
Main content
</div>
</md-sidenav-container>
\ No newline at end of file
app/app-detail.component.ts
0 → 100644
View file @
364b4620
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
App
from
'
../models/app
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
ActivatedRoute
,
Params
}
from
'
@angular/router
'
;
import
'
rxjs/Rx
'
;
@
Component
({
selector
:
'
app-detail
'
,
moduleId
:
module
.
id
,
templateUrl
:
'
app-detail.component.html
'
,
styleUrls
:
[
'
app-detail.component.css
'
]
})
export
class
AppDetailComponent
implements
OnInit
{
app
:
App
;
constructor
(
private
appService
:
AppService
,
private
route
:
ActivatedRoute
)
{
}
async
ngOnInit
()
{
this
.
route
.
params
.
switchMap
((
params
:
Params
)
=>
this
.
appService
.
getApp
(
params
[
'
id
'
]))
.
subscribe
(
app
=>
this
.
app
=
app
);
}
}
app/app.service.ts
View file @
364b4620
...
...
@@ -12,9 +12,10 @@ export class AppService {
}
getApps
():
Promise
<
App
[]
>
{
return
this
.
http
.
get
(
'
http://localhost:8000/apps
'
).
map
((
response
)
=>
{
console
.
log
({
"
id
"
:
"
byabyabya
"
});
return
[
<
App
>
{
"
id
"
:
"
byabyabya
"
}]
}).
toPromise
();
return
this
.
http
.
get
(
'
http://localhost:8000/apps
'
).
map
((
response
)
=>
response
.
json
()).
toPromise
();
}
getApp
(
id
:
string
):
Promise
<
App
>
{
return
this
.
http
.
get
(
`http://localhost:8000/apps/
${
id
}
`
).
map
((
response
)
=>
response
.
json
()).
toPromise
();
}
}
app/apps.component.html
View file @
364b4620
<md-list
*ngIf=
"apps"
>
<md-list-item
*ngFor=
"let app of apps"
>
<md-nav-list>
<h3
md-subheader
>
所有应用
</h3>
<md-list-item
*ngFor=
"let app of apps"
[routerLink]=
"app.id"
>
<img
md-list-avatar
src=
"https://mycard.moe/logo.png"
alt=
"..."
>
<h3
md-line
>
{{app.id}}
</h3>
<p
md-line
>
...
...
@@ -7,4 +8,4 @@
<span
class=
"demo-2"
>
-- {{app.id}}
</span>
</p>
</md-list-item>
</md-list>
</md-
nav-
list>
\ No newline at end of file
app/apps.component.ts
View file @
364b4620
...
...
@@ -3,7 +3,7 @@ import App from '../models/app';
import
{
AppService
}
from
'
./app.service
'
;
@
Component
({
selector
:
'
app
'
,
selector
:
'
app
s
'
,
moduleId
:
module
.
id
,
templateUrl
:
'
apps.component.html
'
,
styleUrls
:
[
'
apps.component.css
'
]
...
...
app/mycard.component.css
View file @
364b4620
:host
{
padding-top
:
64px
;
}
\ No newline at end of file
app/mycard.component.html
View file @
364b4620
<md-toolbar
color=
"primary"
>
<a
md-button
routerLink=
"/"
>
MyCard 开发者控制台
</a>
<a
md-button
routerLink=
"/apps"
>
应用
</a>
<a
md-button
routerLink=
"/
app
s"
>
捆绑包
</a>
<a
md-button
routerLink=
"/
bundle
s"
>
捆绑包
</a>
</md-toolbar>
<router-outlet></router-outlet>
\ No newline at end of file
app/mycard.module.ts
View file @
364b4620
...
...
@@ -20,13 +20,14 @@ import 'rxjs/add/operator/do';
import
'
rxjs/add/operator/filter
'
;
import
'
rxjs/add/operator/map
'
;
import
'
rxjs/add/operator/switchMap
'
;
import
{
AppDetailComponent
}
from
"
./app-detail.component
"
;
@
NgModule
({
imports
:
[
BrowserModule
,
MaterialModule
.
forRoot
(),
FormsModule
,
RoutingModule
,
HttpModule
,
],
declarations
:
[
AppsComponent
,
MyCardComponent
],
declarations
:
[
AppsComponent
,
MyCardComponent
,
AppDetailComponent
],
bootstrap
:
[
MyCardComponent
],
providers
:
[
AppService
],
})
...
...
app/routing.module.ts
View file @
364b4620
/**
* Created by weijian on 2016/12/30.
*/
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
RouterModule
,
Routes
}
from
'
@angular/router
'
;
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
RouterModule
,
Routes
}
from
'
@angular/router
'
;
import
{
AppsComponent
}
from
'
./apps.component
'
;
import
{
AppDetailComponent
}
from
'
./app-detail.component
'
;
const
routes
:
Routes
=
[
{
path
:
''
,
redirectTo
:
'
/apps
'
,
pathMatch
:
'
full
'
},
{
path
:
'
apps
'
,
component
:
AppsComponent
},
{
path
:
''
,
redirectTo
:
'
/apps
'
,
pathMatch
:
'
full
'
},
{
path
:
'
apps
'
,
component
:
AppsComponent
},
{
path
:
'
apps/:id
'
,
component
:
AppDetailComponent
}
];
@
NgModule
({
imports
:
[
RouterModule
.
forRoot
(
routes
)
],
exports
:
[
RouterModule
]
imports
:
[
RouterModule
.
forRoot
(
routes
)
],
exports
:
[
RouterModule
]
})
export
class
RoutingModule
{}
export
class
RoutingModule
{
}
/*
...
...
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