Hi
I’m trying to go through the pluralsight tutorial about Ember.js fundamentals but using ember-cli (I uninstalled ember-data). My app is called GithubExplorer and I have one problem.
I have a simple model in app/models/issue.js
import Ember from 'ember';
export default Ember.Object.extend({
title: "",
body: ""
});
Then I have a controller in app/controllers/repository/newissue.js which tries to create an issue object, like this:
import Ember from 'ember';
export default Ember.Controller.extend({
needs: ['repository'],
repo: Ember.computed.alias('controllers.repository'),
issue: function() {
return GithubExplorer.Issue.create(); // This gives error
}.property('repo.model'),
actions: {
submitIssue: function() {
var issue = this.get('issue');
// Do stuff...
}
}
});
When this is run GithubExplorer.Issue.create()
I get the error Uncaught TypeError: Cannot read property 'create' of undefined
. So, GithubExplorer.Issue is undefined. How do I access the “model” and create it from the issue function?