Last active
February 18, 2021 16:32
-
-
Save HeroicEric/4f5f1c60b09299e06d7e23ea1fd16010 to your computer and use it in GitHub Desktop.
New Twiddle
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 Component from '@glimmer/component'; | |
export default class extends Component { | |
} |
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 Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
} |
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 EmberRouter from '@ember/routing/router'; | |
import config from './config/environment'; | |
const Router = EmberRouter.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('users', function() { | |
this.route('index', function() { | |
this.route('create'); | |
}); | |
}); | |
}); | |
export default Router; |
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 Route from '@ember/routing/route'; | |
export default class IndexRoute extends Route { | |
redirect() { | |
this.transitionTo('users.index'); | |
} | |
} |
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 Route from '@ember/routing/route'; | |
import { inject as service } from '@ember/service'; | |
export default class UsersIndexRoute extends Route { | |
@service usersApi | |
async model() { | |
let users = await this.usersApi.findAll(); | |
return { users }; | |
} | |
} |
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 Service from '@ember/service'; | |
const USERS = [ | |
{ | |
name: 'Jane Cooper', | |
title: 'Regional Paradigm Technician', | |
email: 'jane.cooper@example.com', | |
role: 'Admin' | |
}, | |
{ | |
name: 'Cody Fisher', | |
title: 'Product Directives Officer', | |
email: 'cody.fisher@example.com', | |
role: 'Owner' | |
}, | |
{ | |
name: 'Esther Howard', | |
title: 'Forward Response Developer', | |
email: 'esther.howard@example.com', | |
role: 'Member' | |
}, | |
{ | |
name: 'Jenny Wilson', | |
title: 'Central Security Manager', | |
email: 'jenny.wilson@example.com', | |
role: 'Member' | |
}, | |
{ | |
name: 'Kristin Watson', | |
title: 'Lead Implementation Liaison', | |
email: 'kristin.watson@example.com', | |
role: 'Admin' | |
}, | |
{ | |
name: 'Cameron Williamson', | |
title: 'Internal Applications Engineer', | |
email: 'cameron.williamson@example.com', | |
role: 'Member' | |
}, | |
]; | |
export default class UsersApiService extends Service { | |
async findAll() { | |
return USERS; | |
} | |
} |
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.17.1", | |
"EmberENV": { | |
"FEATURES": {}, | |
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false, | |
"_APPLICATION_TEMPLATE_WRAPPER": true, | |
"_JQUERY_INTEGRATION": true | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js", | |
"ember": "3.18.1", | |
"ember-template-compiler": "3.18.1", | |
"ember-testing": "3.18.1" | |
}, | |
"addons": { | |
"@glimmer/component": "1.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment