Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Add comment about calling _super when overriding init #239

Merged
merged 1 commit into from
Jan 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ export default Ember.Component.extend({
This is useful for things like Components which don't act as proxies, but
again, until this is officially built into the project, YMMV.

**Note: If you override the init function, you must call _super()**

```javascript
export default Ember.ObjectController.extend({
init: function() {
// this call is necessary, don't forget it!
this._super();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for < es6

this._super.apply(this, arguments)

for es6

this._super(...arguments);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanpenner will the es5 version work with es6?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup


// Your init code...
}
});
```

## Validators ##

Expand Down