Baukereg
Baukereg

Reputation: 119

How do I extend a Model in ember-cli

It can be done in 'normal' Ember this way:

App.Person = DS.Model.extend({
  name: DS.attr('string')
});

App.Soldier = App.Person.extend({
  rank: DS.attr('string')
});

How can I achieve this in Ember-cli? I have no idea how to access the raw type of Person.

Upvotes: 3

Views: 2742

Answers (1)

Craicerjack
Craicerjack

Reputation: 6332

import Person from "./person";

export default Person.extend({
  rank: DS.attr('string')
});

in a file named soldier.js.
I think that should do it.

Upvotes: 18

Related Questions