Created
February 10, 2018 15:12
-
-
Save 3gwebtrain/9ea6a6914190a6fe7ed9bad6fcabc5aa to your computer and use it in GitHub Desktop.
Model Test
This file contains 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 Data Sharing' | |
}); |
This file contains 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 Collection from 'ember-cli-mirage/orm/collection'; | |
export default function() { | |
window.server = this; | |
this.get('/foo', function (schema, request) { | |
var posts = [{ | |
author: {name: 'Jane Eyre'} | |
}, { | |
author: {name: 'Emily Dickinson'} | |
}]; | |
return posts; | |
}); | |
this.get('/cards', function (schema, request) { | |
var cards = [{ | |
"txnDate":"22/02/17", | |
"txnAmount":230000 | |
},{ | |
"txnDate":"6/07/16", | |
"txnAmount":180000 | |
},{ | |
"txnDate":"12/09/16", | |
"txnAmount":60000 | |
}]; | |
return cards; | |
}); | |
this.get('/card-list', function (schema, request) { | |
var creditCards = [{ | |
'cardName' : 'HDFC', | |
"cardNum' : 0099887788776655 | |
}, | |
{ | |
'cardName' : 'Standard Chartered', | |
"cardNum' : 0099887788773333 | |
}, | |
{ | |
'cardName' : 'ICICI Bank Ltd', | |
"cardNum' : 0099887788770022 | |
} | |
]; | |
return creditCards; | |
}); | |
}; |
This file contains 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({ | |
server: Ember.inject.service(), | |
model() { | |
return this.get('server.family') | |
} | |
}); |
This file contains 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.Service.extend({ | |
family:Ember.computed(function(){ | |
return $.get('/foo'); | |
}) | |
}); |
This file contains 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
*{ | |
margin:0; | |
padding:0; | |
} | |
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
li{ | |
margin-bottom:1rem; | |
list-style:none; | |
} |
This file contains 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.13.0", | |
"ENV": { | |
"ember-cli-mirage": { | |
"enabled": true | |
} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-data": "2.16.3", | |
"ember-cli-mirage": "0.2.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment