Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.App = Em.Application.create({
- LOG_TRANSITIONS: true
- });
- App.Router.map(function () {
- this.route("index", { path: "/" });
- this.route('search');
- this.route('calendar');
- this.resource("users", function () {
- this.resource("user", { path: "/:user_Id" });
- });
- });
- App.ApplicationAdapter = DS.RESTAdapter.reopen({
- namespace: 'members'
- });
- App.UsersRoute = Ember.Route.extend({
- model: function () {
- return this.store.find('user');
- }
- });
- App.UserRoute = Ember.Route.extend({
- model: function(params) {
- return this.store.find('user', params.user_Id);
- }
- });
- App.IndexRoute = Ember.Route.extend({
- model: function () {
- return this.store.find('user');
- }
- });
- var attr = DS.attr;
- App.UserSerializer = DS.JSONSerializer.extend({
- primaryKey: 'Id'
- });
- App.User = DS.Model.extend({
- FirstName: attr(''),
- MiddleName: attr(''),
- LastName: attr(''),
- FullName: function() {
- return this.get('FirstName') + ' ' + this.get('LastName');
- }.property('FirstName', 'LastName'),
- Email: attr(''),
- HomeAddress: attr(''),
- WorkAddress: attr(''),
- City: attr(''),
- State: attr(''),
- Country: attr(''),
- Zipcode: attr(''),
- HomePhone: attr(''),
- CellPhone: attr(''),
- WorkPhone: attr(''),
- InGroup: attr('boolean'),
- DepartureTime: attr(''),
- ArrivalTime: attr(''),
- UserDob: attr(''),
- UserTypeCode: attr(''),
- DepartureCoord: attr(''),
- DestinationCoord: attr('')
- });
- JSON from C# API
- {
- "FirstName": "Josue",
- "MiddleName": null,
- "LastName": "Cuetara",
- "UserDob": null,
- "Email": "j@h.com",
- "CellPhone": null,
- "Id": 20,
- "HomeAddress": null,
- "City": "Barranquitas",
- "State": "Puerto Rico",
- "Zipcode": "00729",
- "UserTypeCode": 1,
- "UserType": "Conductor",
- "HomePhone": null,
- "WorkPhone": null,
- "Country": "United States",
- "DepartureCoord": "18.325655, -66.106205",
- "DestinationCoord": "18.325655, -66.106205"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement