Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Albin Geraud Kouatcho Nkuigwa
PSE_Projekt
Commits
93fe025d
Commit
93fe025d
authored
Jun 23, 2018
by
Janik Münzenberger
Browse files
Get plant with offline cache
parent
3454f63d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/app/app.module.ts
View file @
93fe025d
...
...
@@ -49,6 +49,7 @@ import {LanguageSwitchComponent} from './components/language-switch/language-swi
import
{
NotificationService
}
from
"
./services/notification.service
"
;
import
{
UserDataService
}
from
'
./services/user-data.service
'
;
import
{
TimeoutDirective
}
from
'
./directives/timeout.directive
'
;
import
{
PlantService
}
from
'
./services/plant.service
'
;
export
function
HttpLoaderFactory
(
http
:
HttpClient
)
{
...
...
@@ -110,7 +111,8 @@ export function HttpLoaderFactory(http: HttpClient) {
],
providers
:
[
AnalysisService
,
ApiService
,
AuthService
,
AuthguardService
,
UserService
,
GardenerService
,
MapService
,
NotificationService
,
UserDataService
],
MapService
,
NotificationService
,
UserDataService
,
PlantService
],
bootstrap
:
[
AppComponent
]
})
export
class
AppModule
{
...
...
src/app/pages/plantdetails/plantdetails.component.ts
View file @
93fe025d
...
...
@@ -7,8 +7,7 @@ import { Subscription } from 'rxjs';
@
Component
({
selector
:
'
app-plantdetails
'
,
templateUrl
:
'
./plantdetails.component.html
'
,
styleUrls
:
[
'
./plantdetails.component.css
'
],
providers
:
[
PlantService
]
styleUrls
:
[
'
./plantdetails.component.css
'
]
})
export
class
PlantdetailsComponent
implements
OnInit
,
OnDestroy
{
plant
:
IPlant
;
...
...
src/app/pages/plants/plants.component.ts
View file @
93fe025d
...
...
@@ -5,8 +5,7 @@ import { PlantService } from '../../services/plant.service';
@
Component
({
selector
:
'
app-plants
'
,
templateUrl
:
'
./plants.component.html
'
,
styleUrls
:
[
'
./plants.component.css
'
],
providers
:
[
PlantService
]
styleUrls
:
[
'
./plants.component.css
'
]
})
export
class
PlantsComponent
implements
OnInit
{
...
...
src/app/services/plant.service.ts
View file @
93fe025d
...
...
@@ -21,7 +21,7 @@ export class PlantService extends DataService{
let
plant
=
await
this
.
readSingleItem
<
IPlant
>
(
id
);
return
plant
;
}
catch
(
err
){
let
plant
=
this
.
plants
.
find
(
plant
=>
plant
.
_id
==
=
id
);
let
plant
=
this
.
plants
.
find
(
plant
=>
plant
.
_id
==
id
);
if
(
!
plant
)
throw
err
;
else
return
plant
;
}
...
...
Write
Preview
Supports
Markdown
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