FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
angular-timer/examples/angularjs-single-timer.html at master · papasax/angular-timer · GitHub
papasax
/
angular-timer
Public
forked from
siddii/angular-timer
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
angular-timer
/
examples
/
angularjs-single-timer.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (35 loc) · 1.2 KB
Breadcrumbs
angular-timer
/
examples
/
angularjs-single-timer.html
Copy path
File metadata and controls
38 lines (35 loc) · 1.2 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
<!DOCTYPE html
>
<
html
>
<
head
>
<
title
>
AngularJS Example - Single Timer Example
</
title
>
<
script
src
="
../bower_components/angular/angular.min.js
"
>
</
script
>
<
script
src
="
../app/js/timer.js
"
>
</
script
>
<
script
>
angular
.
module
(
'MyApp'
,
[
'timer'
]
)
;
function
MyAppController
(
$scope
)
{
$scope
.
timerRunning
=
true
;
$scope
.
startTimer
=
function
(
)
{
$scope
.
$broadcast
(
'timer-start'
)
;
$scope
.
timerRunning
=
true
;
}
;
$scope
.
stopTimer
=
function
(
)
{
$scope
.
$broadcast
(
'timer-stop'
)
;
$scope
.
timerRunning
=
false
;
}
;
$scope
.
$on
(
'timer-stopped'
,
function
(
event
,
data
)
{
console
.
log
(
'Timer Stopped - data = '
,
data
)
;
}
)
;
}
MyAppController
.
$inject
=
[
'$scope'
]
;
</
script
>
</
head
>
<
body
ng-app
="
MyApp
"
>
<
div
ng-controller
="
MyAppController
"
>
<
h1
>
AngularJS - Single Timer Example
</
h1
>
<
h3
>
<
timer
/>
</
h3
>
<
button
ng-click
="
startTimer()
"
ng-disabled
="
timerRunning
"
>
Start Timer
</
button
>
<
button
ng-click
="
stopTimer()
"
ng-disabled
="
!timerRunning
"
>
Stop Timer
</
button
>
</
div
>
<
br
/>
</
body
>
</
html
>
Back
|
FazBrowse Home
|
New Git URL