Last active
October 6, 2018 19:22
-
-
Save jenweber/3fcc2e4e044ae83908031defa0006959 to your computer and use it in GitHub Desktop.
Data management demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default Model.extend({ | |
term: attr('string'), | |
url: attr('string'), | |
definitions: attr() | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EmberRouter from '@ember/routing/router'; | |
import config from './config/environment'; | |
const Router = EmberRouter.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('ember-data') | |
}); | |
export default Router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model() { | |
return [ | |
{ | |
url: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal-seam_gas.aspx", | |
term: "coal-seam gas", | |
definitions: [ | |
{ | |
speech_type: "n.", | |
category: "Geology", | |
definition: "Natural gas, predominantly methane [CH4], generated during coal formation and adsorbed in coal.", | |
see: [ | |
{ | |
title: "unconventional resource", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/u/unconventional_resource.aspx" | |
} | |
], | |
more_details: [ | |
{ | |
title: "Learning to Produce Coalbed Methane", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/1991/or1991jan04_methane.aspx" | |
}, | |
{ | |
title: "Producing Natural Gas from Coal", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/2003/or2003aut02_gas_from_coal.aspx" | |
}, | |
{ | |
title: "Coalbed Methane: Clean Energy for the World", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/2009/or2009sum01_coalbed_methane.aspx" | |
} | |
], | |
synonyms: [ | |
{ | |
title: "coalbed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coalbed_methane.aspx" | |
}, | |
{ | |
title: "coal bed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal_bed_methane.aspx" | |
}, | |
{ | |
title: "coal-bed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal-bed_methane.aspx" | |
}, | |
{ | |
title: "CBM", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/cbm.aspx" | |
} | |
], | |
antonyms: [], | |
alternate_forms: "coal seam gas, CSG", | |
image: { | |
src: "https://www.glossary.oilfield.slb.com/en/Terms/c/en/~/media/PublicMedia/geology/coalbedMethane01.ashx", | |
caption: "Gas adsorption and desorption in coal. During coalification, the matrix shrinks, creating orthogonal fractures called cleats." | |
} | |
} | |
] | |
}, | |
] | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model() { | |
this.store.createRecord('term', | |
{ | |
url: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal-seam_gas.aspx", | |
term: "coal-seam gas", | |
definitions: [ | |
{ | |
speech_type: "n.", | |
category: "Geology", | |
definition: "Natural gas, predominantly methane [CH4], generated during coal formation and adsorbed in coal.", | |
see: [ | |
{ | |
title: "unconventional resource", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/u/unconventional_resource.aspx" | |
} | |
], | |
more_details: [ | |
{ | |
title: "Learning to Produce Coalbed Methane", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/1991/or1991jan04_methane.aspx" | |
}, | |
{ | |
title: "Producing Natural Gas from Coal", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/2003/or2003aut02_gas_from_coal.aspx" | |
}, | |
{ | |
title: "Coalbed Methane: Clean Energy for the World", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/2009/or2009sum01_coalbed_methane.aspx" | |
} | |
], | |
synonyms: [ | |
{ | |
title: "coalbed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coalbed_methane.aspx" | |
}, | |
{ | |
title: "coal bed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal_bed_methane.aspx" | |
}, | |
{ | |
title: "coal-bed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal-bed_methane.aspx" | |
}, | |
{ | |
title: "CBM", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/cbm.aspx" | |
} | |
], | |
antonyms: [], | |
alternate_forms: "coal seam gas, CSG", | |
image: { | |
src: "https://www.glossary.oilfield.slb.com/en/Terms/c/en/~/media/PublicMedia/geology/coalbedMethane01.ashx", | |
caption: "Gas adsorption and desorption in coal. During coalification, the matrix shrinks, creating orthogonal fractures called cleats." | |
} | |
} | |
] | |
} | |
) | |
return this.store.peekAll('term') | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment