Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
889e0c89
Commit
889e0c89
authored
May 02, 2017
by
mdsecurity
Browse files
things update every minute instead of every screen update
parent
4ec4d92c
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/app/place-window/area/area.component.ts
View file @
889e0c89
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
DataProviderService
}
from
'
../../data-provider.service
'
;
import
{
Place
}
from
'
../../
P
lace
'
;
import
{
Place
}
from
'
../../
p
lace
'
;
@
Component
({
selector
:
'
app-area
'
,
templateUrl
:
'
./area.component.html
'
,
...
...
src/app/place-window/area/place-card/place-card.component.html
View file @
889e0c89
...
...
@@ -16,21 +16,20 @@
<div
class=
"title-container"
>
<div
class=
"place-title"
>
{{place.name | removeBrackets}}
</div>
</div>
<div
*ngIf=
"
place.
isOpen
()
; else elseBlock"
>
<div
*ngIf=
"isOpen; else elseBlock"
>
<div
class=
"place-open-badge"
>
<div
class=
"place-status"
>
OPEN
</div>
<div
class=
"place-divider"
></div>
<div
class=
"place-time-remaining"
>
~{{
place.
openFor
()
.hour}}Hrs
</div>
<div
class=
"place-time-remaining"
>
~{{openFor.hour}}Hrs
</div>
</div>
</div>
<ng-template
#elseBlock
>
hello
<!--<div class="closed-shader"></div>
<div
class=
"closed-shader"
></div>
<div
class=
"place-open-badge"
style=
"width:102px;background-color:#C4B9B9;"
>
<div
class=
"place-status"
>
CLOSED
</div>
<div
class=
"place-divider"
></div>
<div class="place-time-remaining">~{{
place.
openFor
()
.hour}}Hrs</div>
</div>
-->
<div
class=
"place-time-remaining"
>
~{{openFor.hour}}Hrs
</div>
</div>
</ng-template>
<div
class=
"place-location"
>
{{place.location }}
</div>
...
...
src/app/place-window/area/place-card/place-card.component.ts
View file @
889e0c89
import
{
Component
,
OnInit
,
Input
}
from
'
@angular/core
'
;
import
{
Place
}
from
'
../../../place
'
;
import
{
Time
}
from
'
../../../time
'
;
import
{
DataProviderService
}
from
'
../../../data-provider.service
'
;
import
{
MdDialog
}
from
'
@angular/material
'
;
import
{
FeedbackDialogComponent
}
from
'
./feedback-dialog/feedback-dialog.component
'
;
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
;
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
;
import
{
Observable
}
from
'
rxjs/Rx
'
;
@
Component
({
selector
:
'
app-place-card
'
,
templateUrl
:
'
./place-card.component.html
'
,
...
...
@@ -13,14 +14,17 @@ import {DomSanitizer} from '@angular/platform-browser';
export
class
PlaceCardComponent
implements
OnInit
{
@
Input
()
private
place
:
Place
;
private
status
:
string
;
private
show
;
private
week
:
string
[]
=
[
"
MON
"
,
"
TUE
"
,
"
WED
"
,
"
THU
"
,
"
FRI
"
,
"
SAT
"
,
"
SUN
"
];
private
url
;
constructor
(
private
dataProvider
:
DataProviderService
,
public
dialog
:
MdDialog
,
private
sanitizer
:
DomSanitizer
)
{
}
private
openFor
=
new
Time
();
private
isOpen
;
private
url
;
constructor
(
private
dataProvider
:
DataProviderService
,
public
dialog
:
MdDialog
,
private
sanitizer
:
DomSanitizer
)
{
}
ngOnInit
()
{
this
.
url
=
this
.
sanitizer
.
bypassSecurityTrustUrl
(
'
https://unsplash.it/200/300?image=
'
+
Math
.
floor
((
Math
.
random
()
*
999
+
1
)));
this
.
url
=
this
.
sanitizer
.
bypassSecurityTrustUrl
(
'
https://unsplash.it/200/300?image=
'
+
Math
.
floor
((
Math
.
random
()
*
999
+
1
)));
let
timer
=
Observable
.
timer
(
0
,
60000
);
timer
.
subscribe
(
t
=>
{
this
.
openFor
=
this
.
place
.
openFor
();
this
.
isOpen
=
this
.
place
.
isOpen
()
});
}
openInContext
()
{
this
.
dataProvider
.
setContext
(
this
.
place
);
...
...
src/app/place.ts
View file @
889e0c89
...
...
@@ -79,7 +79,6 @@ export class Place {
}
}
}
console
.
log
(
'
false
'
);
return
false
;
}
...
...
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