Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bertrand PINEL
EmberCellar
Commits
a60672d1
Commit
a60672d1
authored
Apr 18, 2017
by
Bertrand PINEL
Browse files
First introduction of Ember Data without back API. not working...
parent
e581c638
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/adapters/application.js
0 → 100644
View file @
a60672d1
import
DS
from
'
ember-data
'
;
export
default
DS
.
JSONAPIAdapter
.
extend
({
namespace
:
'
api
'
});
app/models/rack.js
0 → 100644
View file @
a60672d1
import
DS
from
'
ember-data
'
;
export
default
DS
.
Model
.
extend
({
});
app/routes/racks.js
View file @
a60672d1
import
Ember
from
'
ember
'
;
let
racks
=
[
{
name
:
'
Standard grey Rack
'
,
nbColumns
:
6
,
nbRows
:
4
,
image
:
'
./img/rack_01.jpg
'
},
{
name
:
'
Traditional big Rack
'
,
nbColumns
:
10
,
nbRows
:
10
,
image
:
'
./img/rack_02.jpg
'
},
{
name
:
'
Small Wood Rack
'
,
nbColumns
:
3
,
nbRows
:
4
,
image
:
'
./img/rack_03.jpg
'
}
];
export
default
Ember
.
Route
.
extend
({
model
()
{
return
rack
s
;
}
return
this
.
store
.
findAll
(
'
rack
'
)
;
}
});
tests/unit/adapters/application-test.js
0 → 100644
View file @
a60672d1
import
{
moduleFor
,
test
}
from
'
ember-qunit
'
;
moduleFor
(
'
adapter:application
'
,
'
Unit | Adapter | application
'
,
{
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});
// Replace this with your real tests.
test
(
'
it exists
'
,
function
(
assert
)
{
let
adapter
=
this
.
subject
();
assert
.
ok
(
adapter
);
});
tests/unit/models/rack-test.js
0 → 100644
View file @
a60672d1
import
{
moduleForModel
,
test
}
from
'
ember-qunit
'
;
moduleForModel
(
'
rack
'
,
'
Unit | Model | rack
'
,
{
// Specify the other units that are required for this test.
needs
:
[]
});
test
(
'
it exists
'
,
function
(
assert
)
{
let
model
=
this
.
subject
();
// let store = this.store();
assert
.
ok
(
!!
model
);
});
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