You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tasks
Create an articles new controller and validate that the model includes description.
If it is valid, let the action bubble to the route. Otherwise, set an errorMessage.
When I look at the code commits for this portion of the tutorial I would expect to see a file:
app/controllers/articles/new.js
...but I don't see one at all. Am I missing the intent of the task on p 66 of the PDF? When I click the link to look at the changes introduced (262f8c1) there is no articles controller of any type. The final project also does not have a new.js controller for articles.
What I did based on the task is to create the file app/controllers/articles/new.js and put the following code in there:
import Ember from 'ember';
export default Ember.Controller.extend({
hasDescription: Ember.computed.notEmpty('model.description'),
isValid: Ember.computed.and(
'hasDescription'
),
actions: {
save: function () {
console.log('+- save action in articles/new controller');
if (this.get('isValid')) {
return true;
} else {
this.set('errorMessage', 'You have to fill in all the fields');
return false;
}
},
cancel: function () {
return true;
}
}
});
The text was updated successfully, but these errors were encountered:
p.66 of my PDF states this:
When I look at the code commits for this portion of the tutorial I would expect to see a file:
app/controllers/articles/new.js
...but I don't see one at all. Am I missing the intent of the task on p 66 of the PDF? When I click the link to look at the changes introduced (262f8c1) there is no articles controller of any type. The final project also does not have a
new.js
controller for articles.What I did based on the task is to create the file
app/controllers/articles/new.js
and put the following code in there:The text was updated successfully, but these errors were encountered: