FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nativescript-angular/tests/app/first.component.ts at master · NativeScript/nativescript-angular · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
NativeScript
/
nativescript-angular
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
240
Star
1.2k
Code
Issues
294
Pull requests
2
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
nativescript-angular
/
tests
/
app
/
first.component.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (38 loc) · 1.5 KB
Breadcrumbs
nativescript-angular
/
tests
/
app
/
first.component.ts
Copy path
File metadata and controls
42 lines (38 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import
{
Router
,
ActivatedRoute
}
from
"@angular/router"
;
import
{
Component
,
Inject
}
from
"@angular/core"
;
import
{
RouterExtensions
}
from
"@nativescript/angular/router"
;
import
{
HOOKS_LOG
,
BaseComponent
}
from
"./base.component"
;
import
{
BehaviorSubject
}
from
"rxjs"
;
@
Component
(
{
selector
:
"first-comp"
,
template
:
`
<StackLayout>
<Label [automationText]="'first-' + id" [text]="'First: ' + id"></Label>
<StackLayout orientation="horizontal">
<Button [automationText]="'first-navigate-' + id" text="Go to second" (tap)="gotoSecond()"></Button>
<Button [automationText]="'first-navigate-clear-history-' + id" text="With clear history"
(tap)="gotoSecondAndClearHistory()">
</Button>
</StackLayout>
<Label [automationText]="'hooks-log-' + id" [text]="hooksLog | async"></Label>
<Label [text]="'hooks-log-' + id"></Label>
</StackLayout>
`
}
)
export
class
FirstComponent
extends
BaseComponent
{
protected
name
=
"first"
;
public
id
:
string
=
""
;
constructor
(
private
routerExtensions
:
RouterExtensions
,
private
routeData
:
ActivatedRoute
,
@
Inject
(
HOOKS_LOG
)
hooksLog
:
BehaviorSubject
<
Array
<
string
>
>
)
{
super
(
hooksLog
)
;
this
.
id
=
routeData
.
snapshot
.
params
[
"id"
]
;
}
gotoSecond
(
)
{
this
.
routerExtensions
.
navigateByUrl
(
"/second/"
+
this
.
id
)
;
}
gotoSecondAndClearHistory
(
)
{
this
.
routerExtensions
.
navigateByUrl
(
"/second/"
+
this
.
id
,
{
clearHistory
:
true
}
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL