Skip to content

Instantly share code, notes, and snippets.

@herzzanu
Last active May 25, 2025 12:25
Show Gist options
  • Select an option

  • Save herzzanu/f6a0df40a7252d9a573edca8b65af5de to your computer and use it in GitHub Desktop.

Select an option

Save herzzanu/f6a0df40a7252d9a573edca8b65af5de to your computer and use it in GitHub Desktop.
Reviews
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Model from "ember-data/model";
import attr from "ember-data/attr";
import { belongsTo, hasMany } from "ember-data/relationships";
export default Model.extend({
rating: DS.attr(),
comment: DS.attr(),
studentId: belongsTo('user', { inverse: null }),
teacherId: belongsTo('user', { inverse: null }),
});
import Model from "ember-data/model";
import attr from "ember-data/attr";
import { belongsTo, hasMany } from "ember-data/relationships";
export default Model.extend({
name: attr(),
reviewsByMe: hasMany('review', { inverse: null }),
reviewsAboutMe: hasMany('review', { inverse: null })
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('reviews');
this.route('users');
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
});
import Ember from 'ember';
var reviews = [
{
id: 1,
teacher_id: 2,
student_id: 1,
rating: "5",
comment: "hello world"
},
{
id: 2,
teacher_id: 1,
student_id: 2,
rating: "5",
comment: "another great review"
},
];
export default Ember.Route.extend({
model() {
return reviews;
}
});
import Ember from 'ember';
var users = [
{
id: 1,
name: 'John',
reviewsByMe: [1, 2, 3],
reviewsAboutMe: [4, 5]
},
{
id: 2,
name: 'Jane',
reviewsByMe: [4, 5],
reviewsAboutMe: [1, 2, 3]
}
];
export default Ember.Route.extend({
model() {
return users;
}
});
<h1>Welcome to {{appName}}</h1>
{{#link-to "users"}}<button>Users</button>{{/link-to}}
{{#link-to "reviews"}}<button>Reviews</button>{{/link-to}}
<br>
<br>
{{outlet}}
<br>
<br>
<ul>
{{#each model as |user|}}
<li>{{user.id}}</li>
{{/each}}
</ul>
<ul>
{{#each model as |review|}}
<li>{{review.comment}}</li>
{{/each}}
</ul>
<ul>
{{#each model as |user|}}
<li>{{user.name}}</li>
{{/each}}
</ul>
{
"version": "0.10.4",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
@momi8055
Copy link
Copy Markdown

This is exactly what I'm feeling, I think next time they need to be more transparent with marketing, I feel like because they have had previous controllers a lot of people are expecting more in terms of quality. I think a possible solution could be to sell a version with mechanical buttons down the line or a kit that lets you change the buttons.

Either way I'm pretty happy with using this as my daily driver, I also have the Vader 3 pro but mine is a lemon unfortunately

@momi8055
Copy link
Copy Markdown

This is exactly what I'm feeling, I think next time they need to be more transparent with marketing, I feel like because they have had previous controllers a lot of people are expecting more in terms of quality. I think a possible solution could be to sell a version with mechanical buttons down the line or a kit that lets you change the buttons.

Either way I'm pretty happy with using this as my daily driver, I also have the Vader 3 pro but mine is a lemon unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment